Another way to embed images in E-mail when using System.Net.Mail is to attach the image from the local drive to the email and assign it a contentID , and then use that contentID in the image URL.
This can be done as follows:
msg.IsBodyHtml = true; Attachment inlineLogo = new Attachment(@"C:\Desktop\Image.jpg"); msg.Attachments.Add(inlineLogo); string contentID = "Image"; inlineLogo.ContentId = contentID; //To make the image display as inline and not as attachment inlineLogo.ContentDisposition.Inline = true; inlineLogo.ContentDisposition.DispositionType = DispositionTypeNames.Inline; //To embed image in email msg.Body = "<htm><body> <img src=\"cid:" + contentID + "\"> </body></html>";
source share