Why won't an embedded image show in html emails?

I'm looking to embed a header image into an HTML email generated by c#.  I've found code that is supposed to work, but the email arrives with the usual red x saying that it has no image.  (The same happens in Hotmail).  However, if I forward it, the attachment appears and so does the image.  Any ideas what might be going wrong?
if (EmailType == "ConfirmRegistration")
        {
            message.IsBodyHtml = true;
            string contentId = "headerImage";
            string path = HttpContext.Current.Server.MapPath(@"img/Email/Header.jpg");
            LinkedResource header = new LinkedResource(path, MediaTypeNames.Image.Jpeg);
            header.ContentId = "header";
            AlternateView av1 = AlternateView.CreateAlternateViewFromString("<html xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns=\"urn:schemas-microsoft-com:office:office\" xmlnso=\"urn:schemas-microsoft-com:office:word\" xmlns:m=\"http://schemas.microsoft.com/office/2004/12/omml\" xmlns=\"http://www.w3.org/TR/REC-html40\"><META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=us-ascii\"><body><img src=cid:header/><br></body></html>" + sEmailBody, null, MediaTypeNames.Text.Html);
            av1.LinkedResources.Add(header);
            message.AlternateViews.Add(av1);
        }
        smtpClient.Send(message);

Open in new window

Email.JPG
HotmailforwardedEmail.JPG
mkingshottAsked:
Who is Participating?
 
Anurag ThakurTechnical ManagerCommented:
0
 
Éric MoreauSenior .Net ConsultantCommented:
can you test if the example from http://www.emoreau.com/Entries/Articles/2007/09/Using-SystemNetMail.aspx is working for you (because it is for me)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.