I have an application that sends an HTML formatted email with embedded images. The email looks perfect on many different desktop/web clients. When the email is viewed on a mobile phone that supports HTML email (tested on iPhone, WinMo 6.1) the images are displayed as red 'X's. All other HTML is being displayed correctly. To be clear, the problem is ONLY occurring on mobile clients and not on desktop clients.
The code to embed images is working perfectly and I don't believe there is any problem with it but I've included some quick sample code below just in case:
MailMessage mail = new MailMessage();
mail.To.Add("[email protected]");
mail.From = new MailAddress("456@ myemail.com");
mail.Subject = "Image sample - fails in mobile clients";
string Body = "Sample email text<img src=\"cid:imageId\" />";
AlternateView htmlView = AlternateView.CreateAlternateViewFromString(Body, null, "text/html");
LinkedResource lr = new LinkedResource("myImage.jpg");
lr.ContentId = "imageId";
htmlView.LinkedResources.Add(lr);
mail.AlternateViews.Add(htmlView);
SmtpClient smtpClient = new SmtpClient();
smtpClient.Send(mail);
Does anyone know why embedded images are not displayed on mobile clients? Better yet, how can I get the images to display correctly?
Edit: If Outlook 2007 (and above) sends an email with images then the images are displayed correctly in a mobile client and desktop client. If an HTML formatted email is sent with embedded images then the images are not displayed correctly in the mobile client but are correctly displayed in a desktop client.
How is Outlook able to send emails with images confidently displayed but if sent through a web app (using embedded images) the mobile client blocks the images. What is the difference between the two?