In the HTML there are two images:
<IMG SRC="cid:#IMG01#" >
<IMG SRC="cid:#IMG02#" >
The C# code is:
var message = new MailMessage
{
Priority = MailPriority.Normal,
Sender = new MailAddress(utente.Email, "xxx.it"),
From = new MailAddress(utente.Email, "xxx.it")
};
message.To.Add(new MailAddress("xxx@tiscali.it", "aaaaaaaa"));
message.Subject = "xywz";
message.IsBodyHtml = true;
message.Body = Modello;
Attachment AttPrinc = new Attachment(path + "Attachment.pdf");
message.Attachments.Add(AttPrinc);
string contentID1 = "IMMAGINE01";
string contentID2 = "IMMAGINE02";
Modello = Modello.Replace("#IMG01#", contentID1);
Modello = Modello.Replace("#IMG02#", contentID2);
LinkedResource InlineImg01 = new LinkedResource(path + "img01.jpg", "image/jpg");
InlineImg01.ContentId = contentID1;
LinkedResource InlineImg02 = new LinkedResource(path + "img02.jpg", "image/jpg");
InlineImg02.ContentId = contentID2;
AlternateView htmlView = AlternateView.CreateAlternateViewFromString(Modello, null, "text/html");
htmlView.LinkedResources.Add(InlineImg02);
htmlView.LinkedResources.Add(InlineImg01);
message.AlternateViews.Add(htmlView);
var mailClient = new SmtpClient();
mailClient.Send(message);
I send the email and, on my PC with Thunderbird, I see all correct, on my PC with the webmail, I see the images, on my phone (Huawey Mate 8) with webmail, I don't see the images. I send the email to other persons (tester), and some of them can see the images, some others can't see the images. I'm going crazy.
Any suggestion?