0

How can I distinguish between an image in the body of an email and an image attached to an email using the NetOffice.Outlook C# library?

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45
Alldman
  • 15
  • 7

1 Answers1

1

It doesn't matter whether you use NetOffice or not, you can distinguish images used in the message body by checking the src attribute. In case embedded images you could see the following construction:

<img src="cid:image.png"/>

Where the cid: indicates that the image mentioned represents an attached file and used in the message body as an image.

You may try getting the PR_ATTACH_CONTENT_ID property value on the attached file (the DASL name is "http://schemas.microsoft.com/mapi/proptag/0x3712001F") using the PropertyAccessor object. The value is used for the cid attribute in the HTML markup. The PropertyAccessor.GetProperty method can help with such tasks.

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45