Why are the embedded image in HTML email not displayed in OUTLOOK 2010?

Posted on 2012-09-12
Last Modified: 2012-09-18
Hi All,
I created HTML email template and sent email to OUTLOOK 2010. But I found the embedded images were not displayed. They are displayed as squares with red cross.

HTML Template:

        text-align: center;

    <table class="" cellpadding="0" cellspacing="0" border="0" width="752">    
          <td class="border"><img alt="" src="images/header.jpg" /><br /><br /></td>
          <td class="border"><br /><img alt="" src="images/footer.jpg"
                  style="width: 961px" /></td>

var message = new MailMessage
                                        From = new MailAddress(mail.From),
                                        To = new MailAddress(mail.To),
                                        Subject = mail.Subject,
                                        Body = mail.Body,
                                        IsBodyHtml = true,
                                        BodyEncoding = Encoding.UTF8,
                                        SubjectEncoding = Encoding.UTF8,

var client = new SmtpClient();

I tried the following solutions but none is working:
1. Unblock picture downloads for all messages

    On the Tools menu, click Trust Center, and then click Automatic Download.
    Clear the Don't download pictures automatically in HTML e-mail messages or RSS items check box.

2. clear the SecureTemp folder and delete the contents

3. untick the 'show picture placeholder' on outlook2010

Does anyone know what is going on?

thanks heaps
Question by:viola123
    LVL 16

    Accepted Solution

    In your email body you have not specified the correct source for the image.

    The line:

    <img alt="" src="images/footer.jpg">

    Should have the complete URL to find the image. By way of example if your website is "" then the line would be:

    <img alt="" src="">

    Then when the email is viewed the image is downloaded from your website.

    On the other hand, if you are including the email as "inline-attachments" in a multi-part email message, the image source would need to reflect that.
    LVL 6

    Author Comment

    thanks a lot, i will try to put my images under our website folder.
    i will let you know the result.
    LVL 26

    Assisted Solution

    by:Alan Warren
    Hi viola123,
    you'd stand a better chance of the image being displayed if it was embedded as an attachment to the mail message.

    LinkedResource Class
    Represents an embedded external resource in an email attachment, such as an image in an HTML attachment.

    Asp .Net VB sample sending email with linked resources embedded in html:
    <%@ Page Language="VB" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
    <script runat="server">
      Protected Sub ButtonSendCoolPic_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ButtonSendCoolPic.Click
        ' we won't be needing this, maybe...
        Dim strError As String = ""
        ' Populate the smtp server name
        Dim strSmtpMailServer As String = ""
        ' Populate the smtp user name credential
        Dim strSmtpUsername As String = ""
        ' Populate the smtp password credential
        Dim strSmtpPassword As String = "validmailuserpassword"
        ' Create the NetworkCredential object
        Dim objNetworkCredential As New System.Net.NetworkCredential(strSmtpUsername, strSmtpPassword)
        ' Create the SmtpClient object
        Dim objSmtpClient As New System.Net.Mail.SmtpClient(strSmtpMailServer)
        ' Parse the NetworkCredential to the smtpclient object
        objSmtpClient.Credentials = objNetworkCredential
        Dim objMailMessage As System.Net.Mail.MailMessage = Nothing
        ' Represents an embedded external resource in an email attachment, such as an image in an HTML attachment.
        Dim objLinkedResource1 As System.Net.Mail.LinkedResource = Nothing
        Dim objHTLMAltView As System.Net.Mail.AlternateView = Nothing
        ' Usual stuff
        Dim strRecipientName As String = "Some Recipient"
        Dim strRecipientEmail As String = ""
        Dim strSenderName As String = "Me"
        Dim strFrom As String = ""
        Dim strSubject As String = "Cool Pic!"
        ' the html body
        Dim strBody_Html As String = ""
        ' the physical path to the image
        Dim strLinkedResource1PhysicalPath As String = Server.MapPath("~/") & "pics\cool-pic.jpg"
        ' Construct the alternate body as HTML.
        strBody_Html = "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' ''>" + vbLf
        strBody_Html += "<html xmlns=''>" + vbLf
        strBody_Html += "  <head>" + vbLf
        strBody_Html += "    <title></title>" + vbLf
        strBody_Html += "  </head>" + vbLf
        strBody_Html += "  <body>" + vbLf
        strBody_Html += "    <div>" + vbLf
        strBody_Html += "      <table>" + vbLf
        strBody_Html += "          <tr>" + vbLf
        strBody_Html += "            <td>" + vbLf
        strBody_Html += "              <h3>Hi " & strRecipientName & ",</h3>Check this cool pic!" + vbLf
        ' populate the src of the image with the linkedresource.cid 
        strBody_Html += "              <img src='cid:cool_pic'  />" + vbLf
        strBody_Html += "            </td>" + vbLf
        strBody_Html += "          </tr>" + vbLf
        strBody_Html += "      </table>" + vbLf
        strBody_Html += "    </div>" + vbLf
        strBody_Html += "  </body>" + vbLf
        strBody_Html += "</html>" + vbLf
          ' Create a message and set up the recipients.
          objMailMessage = New System.Net.Mail.MailMessage()
          ' Populate the From line of the mail message
          objMailMessage.From = New System.Net.Mail.MailAddress(strFrom)
          ' Populate the subject line of the mail message
          objMailMessage.Subject = strSubject
          objLinkedResource1 = New System.Net.Mail.LinkedResource(strLinkedResource1PhysicalPath, "image/jpeg")
          ' create a handle that we can reference in the src property of the embedded image
          objLinkedResource1.ContentId = "cool_pic"
          ' Add the linked resource/s to the AlternateView.
          objHTLMAltView = System.Net.Mail.AlternateView.CreateAlternateViewFromString(strBody_Html, New System.Net.Mime.ContentType("text/html"))
          ' Add the alternate view to the message.
          ' Set the Priority property of the mail message [Low=0,Normal=1,High=2]
          objMailMessage.Priority = System.Net.Mail.MailPriority.Normal
          ' Send the message.
        Catch ex As Exception
          ' parse the error and return it to the calling procedure
          strError = ex.Message
        End Try
      End Sub
    <html xmlns="">
    <head runat="server">
      <form id="form1" runat="server">
          <asp:Button runat="server" Text="Send Cool Pic" ID="ButtonSendCoolPic" />

    Open in new window

    LVL 6

    Author Comment

    Hi Alan,
    thanks for reply, i will try this one as well.

    thanks heaps
    LVL 47

    Assisted Solution

    If you are using a custom Template/Form
    Depending on who you are sending it to
    You may need to make sure the Recipients got a local copy saved in their Forms LIbaray
    Otherwise it going to get to the recipient and outlooks not going to have the information to interpret it

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Learn more about how the humble email signature can be used as more than just an electronic business card. When used correctly, a signature can easily be tailored for different purposes by different departments within an organization.
    Sometimes Outlook might have problems sending a message. There may be various causes- corrupted PST, AV scanner etc. The message, instead of going to the Sent Items folder, sits in the Outbox indefinitely. To remove it you can use a free tool cal…
    Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
    This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now