I am sending an email via ASP.NET MVC 4 using System.Net.Mail and I am trying to embed an image in it like so:
message = "<br/><br/><img src='/Images/cp-map.jpg' /><br/><br/>";
MailAddress to = new MailAddress(firstname.lastname@example.org);
MailAddress from = new MailAddress(“email@example.com");
MailMessage email = new MailMessage(from, to);
email.Subject = “Subject”;
email.Body = message;
email.IsBodyHtml = true;
SmtpClient client = new SmtpClient("mail.email.com");
The image url should be an absolute url (a url which you can copy and paste to any browser window and you will be able to see the image), not a relative url because when you open the email from any email provider's web app(ex: gmail.com), it is trying to load the image from relative path which might not exist in gmail's web app.
This should work.
var imgUrl="https://www.yourSite.com/Images/cp-map.jpg"; message = "<br/><br/><img src='"+imgUrl+"' /><br/><br/>";
yourSite with your actual site name or another domain where the images are hosted with the same url pattern.