简体   繁体   中英

Outlook email picture attachment not showing, when I displaying outlook html email body in asp.net page

I am working on outlook application (asp.net c#), actually I am importing all outlook email data into SQL server database, And want to display it in .aspx page. I am able to get the outlook email body as an HTML and it working good. But I am facing problem in get images which are the part of emails. (I can save the attachment but, how Can I bind it with outlook email, same as these displaying in outlook)? In outlook email body(html) there is this type of img source, here what is cid? and @@01CFE7F9.54FD40B0? can any one help me

<img border=0 width=22 height=22 id="Picture_x0020_4" src="cid:image003.jpg@01CFE7F9.54FD40B0" alt="Description: tweet.png">

It looks like in this case Outlook stores the images in the attachments - HTML body refers to them, as <img src="cid:xyz"> , where xyz is the value of the PR_ATTACH_CONTENT_ID attachment property (accessible by using Attachment.PorpertyAccessor.GetProperty - PR_ATTACH_CONTENTID DASL property name is http://schemas.microsoft.com/mapi/proptag/0x3712001F ).

You can either

  1. Save the message in the MHTML format - it embeds the pictures and IE can display MHTML files.

  2. Replace the <img src="cid:xyz"> tags with the image data extracted from the attachment (Attachment.SaveAsFile) and embedded inside the img tag, eg <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIA..." /> . If using Redemption is an option, it can save messages in that format using RDOMail .SaveAs(..., olHTMLEmbeddedImages)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM