Sicos1977 / MSGReader

C# Outlook MSG file reader without the need for Outlook

Home Page:http://sicos1977.github.io/MSGReader

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Inline Attachments embedded in RTF Mails are corrupted

dominik1996 opened this issue · comments

Describe the bug
Inline Attachment embedded into RTF Mails seem to be corrupted when exporting them.
Attached is one of our Files (Beispiel-E-Mail RTF.zip) (as MSG in Zip).

To Reproduce
Steps to reproduce the behavior:

  1. Using the sample Code below we extract the content of the Attachment.
  2. We then convert this to base64 or export it as file
  3. Neither the base64 string nor the exported file is valid (exported file won't open (on Windows) since it is corrupted)
var message = new Storage.Message(fileStream);
var attachmentsToExport = message.Attachments.OfType<Storage.Attachment>().ToList();

var attachment = attachmentsToExport.First();

// We then use attachment.Data to convert to base64 or to export as file
// File.WriteAllBytes(..)
// Convert.ToBase64String(..)

Expected behavior
As in Version 5.2.5 the images should be extracted correctly. 5.2.5 is the last Version that is working for us.

Desktop (please complete the following information):

  • OS: Windows 10
  • Version: 5.5.7

Additional context
As described we receive an error while trying to open the file after export:
image

commented

I tried your example file but that one is working fine for me... the attachment is also extracted correctly.

commented

No response... closed