Thread: ASP.NET/Embed an Image in Email using ASP.NET

Embed an Image in Email using ASP.NET

www.codeproject.com/KB/aspnet/EmbedImage.aspx


htmlView = System.Net.Mail.AlternateView.CreateAlternateViewFromString("<html><body " & _

   "style='font-family:Segoe UI, Arial; font-size: 11pt;'><p>" & _

   txtBody.Text.Trim & "</p>'<img src='cid:image1'></body></html>", Nothing, "text/html")


img src="cid:image1"

imageResourceEs.ContentId = "image1"


!Inside the HTML message create the "holders" for the images

img src=
"cid:image1"

img src="cid:image2"



! Create the resources

Dim lkImage1 As New

System.Net.Mail.LinkedResource(FileName,
"image/gif")



Dim lkImage2 As New

System.Net.Mail.LinkedResource(FileName,
"image/gif")



! Link the resources

lkImage1.ContentId =
"image1"

lkImage2.ContentId = "image2"


www.systemnetmail.com/faq/4.4.aspx