We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Problem with MSG encoding


we try to get an EMail from Exchange Server and save it with Aspose to an .msg file.
Unfortunately the subject gets the wrong encoding when saved to msg format.
If we save the same message to an eml file and open it (e.g. with Thunderbird), everything is correct.

This is the code we use:

MemoryStream mapiStream = new MemoryStream(mail.MimeContent.Content);
MailMessage msg = MailMessage.Load(mapiStream);
msg.Save(tempFile, MessageFormat.Msg);

I attached two screenshots. One shows the the converted msg file in Outlook and the other one shows the correct msg file in Thunderbird.

Bye Sven

Hello Sven,

Thank you for inquiry.

Could you please try
msg.Save(tempFile, MailMessageSaveType.OutlookMessageFormatUnicode);

Hello Saqib,

thank you very much for your fast and helpful reply.

Now the conversion works perfectly. :slight_smile:

With best regards

Sven Buth