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

Free Support Forum - aspose.com

Encoding problem with MailMessage body


I’m using the following test code with Aspose.Network 5.1 to save a MailMessage with special characters:

MailMessage msg = new MailMessage();
msg.PreferredTextEncoding = Encoding.Unicode;
msg.From = "noreply@test.com";
msg.Subject = "Russian (русский язык)";
msg.HtmlBody = "Russian (русский язык, transliteration: russkiy yazyk, Russian pronunciation: [ˈruskʲɪj jɪˈzɨk], meaning 'Russian tongue [language]') is the most geographically widespread language of Eurasia.";
msg.Save("c:\\temp\\savedmessage.msg", MailMessageSaveType.OutlookMessageFormatUnicode);

When I open the resulting msg file in Outlook 2007, the subject has correct characters but the body reads:

"Russian (ðóññêèé ÿçûê, transliteration: russkiy yazyk, Russian pronunciation: [?rusk??j j??z?k], meaning 'Russian tongue [language]') is the most geographically widespread language of Eurasia."

It seems as though the body encoding is incorrectly applied during the Save(). If I debug and inspect the property values, the Visual Studio debugger displays the correct characters.

Note that this issue persists even if I load the MailMessage into a MapiMessage and then Save. I've also tried using Streams to save the resulting msg, this problem remains.

Please help as we are licensed for Aspose.Total and this functionality is critical to our project.



We have reproduced the issue and will try to solve it as soon as possible. We will notify you as soon as we fix this. Sorry for the inconvenience.


we are evaluating the component at the moment and have a similiar problem with the attached eml-file. The attachment is correctly converted, but the message body contains question marks instead of the unicode characters.

We are using the following code:

Aspose.Network.Mail.MailMessage mMessage;

mMessage = Aspose.Network.Mail.MailMessage.Load(@“D:\work\test.eml”, Aspose.Network.Mail.MessageFormat.Eml);

mMessage.Save(@“D:\work\test.msg”, Aspose.Network.Mail.MailMessageSaveType.OutlookMessageFormatUnicode);

Is this perhaps the same issue or another one?


This issue is related to the first post. We are looking into it and will get back to you as soon as it gets resolved. Sorry for the inconvenience.

The issues you have found earlier (filed as 16355;16009) have been fixed in [this update ](http://www.aspose.com/community/files/51/.net-components/aspose.network-for-.net/entry235287.aspx).

This message was posted using Notification2Forum from Downloads module by aspose.notifier.