outlookbase64outlook-2007vml

VML base64 image


I use html signature for Outlook 2007. The signature contains a few image file. I want embed image files so it's shouldn't be on attachment. But v:image doesn't show image.

<!--[if gte vml 1]>
    <v:image style="width:104px;height:108px;" src="data:image/jpg;base64,/9j/4AAQSkZ......AgEAgEAgEAgEAgP//Z">
        </v:image>
    <![endif]-->
    <![if !vml]><img width=104 height=108
src="data:image/jpg;base64,/9j/4AAQSkZJR...AICpUuZdbmkMBXsnT3knOxse8nkcs+B4iAtsAgEAgEAgEAgEAgEAgP//Z" alt="footer_logo.jpg" v:shapes="Resim_x0020_4"><![endif]>

Solution

  • Outlook uses Word to render the images, and Word does not support embedded (src="data:image") images. You need to attach the image as a file, set the PR_ATTACH_CONTENT_ID property on the attachment (Attachment.PropertyAccessor.SetProperty), and make sure your HTML refers to the image through the src=cid:xyz attribute (where xyz is the value of the PR_ATTACH_CONTENT_ID property).

    PR_ATTACH_CONTENT_ID property DASL name is http://schemas.microsoft.com/mapi/proptag/0x3712001F