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

Free Support Forum - aspose.com

Problems saving Outlook Unicode MSG file as MHTML

Hi,


I’m currently evaluating Aspose.Email for our business needs (using in combination with Aspose.Words in order to convert emails to PDF’s). We have clients in both Europe and Asia, so it’s important that we fully support unicode characters.

I created an email with Korean and Chinese characters and they all appeared as question marks in the output MHTML file.

So far, we are able to do everything we want with the toolset, but this would be a showstopper for us.

Is this a bug or is there some other way to do this?

Thanks

Jeff



Hi Jeff,

Thank you for considering Aspose.Email for .NET.

Can you please share your sample email message files with us for our reference? We will investigate these at our end for assisting you further. Also, please make sure that you are using the latest version of the API i.e. Aspose.Email for .NET 6.2.0 in your application.

Hi,

I've discovered the cause of the problem. When saving the MSG file originally I was using SaveOptions.DefaultMsg instead of SaveOptions.DefaultMsgUnicode.

The resulting MSG file for both options contains proper Unicode characters, however when creating the MHTML file, they are all lost for the one that used SaveOptions.DefaultMsg.

Consider this problem resolved.

Thanks for responding so quickly.

Regards,

Jeff

Hi Jeff,

Thank you for sharing your feedback.

Just for your information, in case the message is saved as DefaultMsg and loaded again for conversion to Mhtml, you can use the Message.PrefferredTextEncoding field to specify the encoding for conversion that will lead to correct result.

Sample Code:

MailMessage msg = new MailMessage();

msg.IsBodyHtml = true;

msg.Body = “이것은 한국어 언어입니다.”;

msg.Save(“AEMsgKorean.msg”, Aspose.Email.Mail.SaveOptions.DefaultMsg);

msg = MailMessage.Load(“AEMsgKorean.msg”, new MsgLoadOptions());
msg.PreferredTextEncoding = Encoding.UTF8;

msg.Save(“AEMsgKorean.mhtml”, Aspose.Email.Mail.SaveOptions.DefaultMhtml);