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

Free Support Forum - aspose.com

Saving MailMessage as OutlookMessageFormat loses HTML body

Hi,

I’m using Aspose.Network.Exchange to open a user’s mailbox and save emails as .msg files with code along these lines.

ExchangeClient client = new ExchangeClient(mailboxUri, user, password);
MailMessage message = client.FetchMessage(messageUri);
message.Save(@“C:\test.msg”, MailMessageSaveType.OutlookMessageFormat);
The emails in the mailbox are in HTML format, but when I open the saved version Outlook shows me a rich-text version with incorrect formatting. If I use MailMessageSaveType.EmlFormat the correct HTML body is saved, which is great except that I need .msg files, not .eml.

I am using what I believe is the latest version, 4.8.1.1. How can I save .msg files with a HTML body and have them open correctly in Outlook?

Thanks,
Alex.



Hi Alex,

Thanks for considering Aspose.

Could you please send us the sample msg file for which the formatting is incorrect. Please first save the message as .msg file using Aspose and then retrieve the same message using Microsoft Outlook.

You may post on this forum as an attachment or send as email by using forum options “contact” --> “send saqib.razzaq an email”. We will look into this issue.

I have emailed you examples as requested.

Thanks,
Alex.

Hi Saqib,

Have you been able to look at the examples I sent you?

Regards,
Alex.

Hi Alex,

This is a bug and a known issue with Aspose.Network. Text formatting and inline images are not saved properly when we save in .msg format.

Our developers are working on it. The Bug ID for this issue in our system is 12534. We will notify you here when there is feedback or it gets resolved. Sorry for the inconvenience.

Hi Saqib,



Do you have any updates on the availability of the fix?



Thanks,

Alex.

Hi Alex,

Our developers are still working on it. We will update you when there is some progress.

Hi Saqib,



Do you have an updates on the progress of the fix for this issue?



Thanks,

Alex.

Hi Alex,

I am sorry, this bug is not fixed yet. We are working on it and will notify you at our earliest as soon as it gets fixed.

Damn, I think I run into the same problem when creating a .msg file.

MailMessage mailMessage = new MailMessage();
mailMessage.Subject = "Test Nieuwsbrief";
mailMessage.HtmlBody = htmlContent;

try
{
mailMessage.Save("c:\\file.eml",MailMessageSaveType.EmlFormat);
}
catch (Exception exc)
{

}

This works fine! The eml file open in Windows Live and shows the correct HTML body. When saving to OutlookMessageFormat the msg file is created but shows incorrect HTML Body (all formatting is gone, messed uped etc.)

Hope you get a solution for this soon. Any idea at the expected time frame?

Regards,
Willem Jan

Hi Willem,

Unfortunately, I do not know about the estimated time for fixing this issue. We will notify you when it gets resolved. Sorry for the inconvenience.

The issues you have found earlier (filed as 12534) have been fixed in this update.


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

Thanks Aspose, this is a great release that fixes our major issues. Big pats on the backs to your hard working devs!

The only way it could be improved is in handling email attachments to emails. When I save an email as .msg, any attached emails appear as ATT00001.eml.msg, ATT00002.eml.msg etc. but users are more used to seeing the subject line as the file name. If you could make attached emails appear as, for example, “FW: test email.msg” or “Meeting minutes.msg” that would be utterly brilliant :slight_smile: