I am trying to send email from my ASP.NET Web forms application and the email body has an image. I followed the below discussion and able to set the image as base64-data string.
After setting the image src in HTML template (used for building email content), I am using the following c# code for setting the cid value.
C#
AlternateView htmlView = AlternateView.CreateAlternateViewFromString("<img src=cid:applogo>", null, "text/html");
LinkedResource logo = new LinkedResource(@"\\app\images\emailheader.png");
logo.ContentId = "applogo";
htmlView.LinkedResources.Add(logo);
mailMessage.AlternateViews.Add(htmlView);
What Works:
The image is displaying properly when the email is viewed in a browser.
Issue:
The image is not displaying when the email is viewed in Outlook 2010.
Question:
Is there any setting I need to apply or is there any compatibility issue?