Sicos1977 / MSGReader

C# Outlook MSG file reader without the need for Outlook
http://sicos1977.github.io/MSGReader
MIT License
490 stars 168 forks source link

Determining inline attachments #319

Closed Erapchu closed 1 year ago

Erapchu commented 1 year ago

Retrieve the Attachments property on Message object will return all attachments, but some of them has incorrect IsInline property.

  1. Start read .msg file with embedded attachments: var message = new MsgReader.Outlook.Storage.Message(mailStream)
  2. Get property Attachments before BodyHtml
  3. All attachments wouldn't be embedded in message text, but some of them embedded to HTML.

To avoid this and determine is attachment embedded or not, I need to get BodyHtml before Attachments property - this have impact on memory using.

Expected behavior Correct property set is embedded attachment or not - IsInline on Attachment.

I think it's required to get BodyHtml only if attachments count > 0 to set correct IsInline or not?

Sicos1977 commented 1 year ago

Implemented with this commit 97d898d72fb6da9aa67ff7c02938682ea2db02a1