Hi,
Hi Hamish,
Thank you for posting your inquiry.
You can save a MailMessage to Memory Stream in HTML format using the following sample code. Please try it at your end and let us know if you need further help.
Code:
MailMessage msg = MailMessage.Load("1.eml");
Aspose.Email.Mail.HtmlSaveOptions htmlSaveOptions = new Aspose.Email.Mail.HtmlSaveOptions();
htmlSaveOptions.EmbedResources = true;
MemoryStream ms = new MemoryStream();
msg.Save(ms, htmlSaveOptions);
That works perfectly, thank you. Much better than what I could come up with (stream to an Aspose.Words MHTML document, stream that to a MailMessage and then use a StreamReader to get the string).
Hi Hamish,