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

Free Support Forum - aspose.com

Encoding problem when load eml and save as Msg

Hi Expert,

I tried to load an eml (with UTF8 encoding on subject and body) and then save as msg using the following code.

Aspose.Email.Mail.MailMessageLoadOptions options = new Aspose.Email.Mail.MailMessageLoadOptions();

options.PrefferedTextEncoding = Encoding.GetEncoding(“UTF-8”);
options.MessageFormat = MessageFormat.Eml;

MailMessage msg = MailMessage.Load(“c:/temp/aspose/SharepointChinese.eml”, options);

msg.Save(“c:/temp/aspose/SharepointChinese.msg”, MailMessageSaveType.OutlookMessageFormatUnicode);

I found that the subject encoding is correct while the aspose interpretted wrongly on body’s encoding. The “chinese” utf characters on the body of saved message become garbage.

Hi Lewis,

Thank you for writing to Aspose support team.

I have analyzed the mentioned issue in light of the available sample EML file and have resaved it to disc using the latest version of Aspose.Email for .NET 4.6.1 but was unable to observe the same at my end. The resaved files are attached here for your kind reference. Could you please try it with this latest version and let us know your feedback? If the problem still persists, I will request you to please help us identify the issue by sharing a screenshot of the problem with us. We’ll look into it for assisting you further.