Inline – Base64 Image Send Mail
MailMessage oMailMessage = new MailMessage(); int PictureId = 1; string ImgUrl = "Base64Data"; string cidPictureId = "picture" + PictureId; byte[] data = System.Convert.FromBase64String(ImgUrl); MemoryStream ms = new MemoryStream(data); string htmlBody = "<h3>Mail Body İçereği</h3><img src=\"cid:" + cidPictureId + "\">"; AlternateView avHtml = AlternateView.CreateAlternateViewFromString(htmlBody, null, MediaTypeNames.Text.Html); ms.Position = 0; LinkedResource picture = new LinkedResource(ms) { ContentId = cidPictureId }; avHtml.LinkedResources.Add(picture); oMailMessage.AlternateViews.Add(avHtml); oMailMessage.From = new MailAddress("kalebasiyakup@gmail.com", "Yakup From"); oMailMessage.To.Add(new MailAddress("kalebasiyakup@gmail.com", "Yakup To")); oMailMessage.Subject = "A picture using alternate views"; SmtpClient client = new SmtpClient("smtp.sunucu.com"); client.Send(oMailMessage);