I am attempting to attach image files to emails sent by my website.
I have followed the method used here
http://www.aspnettutorials.com/tutorials/email/email-with-img-asp4-cs/
This is the code I have written
string smtpServer = "my server";
SmtpClient client = new SmtpClient(smtpServer);
MailMessage message = new MailMessage();
string img = "/img/emails/test.png";
Attachment imgAtt = new Attachment(HttpContext.Current.Server.MapPath(img));
imgAtt.ContentId = Path.GetFileName(img);
//add the attachment to the email
message.Attachments.Add(imgAtt);
message.From = new MailAddress("example@example.com");
message.To.Add(new MailAddress("otherexample@example.com"));
message.Subject = "test";
message.Body = "<img src=\"cid:test.png\">";
message.IsBodyHtml = true;
client.Send(message);
This is working fine accept when the person receiving the email uses Mac Mail. In this case the image is displayed twice when the person views the email. Is there a solution to this problem?
Edit: I have tried the solution on sending mail along with embedded image using asp.net. However I have had the same outcome. Users with mac mail still see the image twice.