Hi Martin,
Thanks for considering Aspose.
Saving an email (with embedded images) as msg does not work correctly in the current release. Its a known issue and we are working on it.
But, if you load an mht file using Aspose.Network.MailMessage class and save as eml, embedded images are included in the eml file. If you open the eml file in Outlook Express, you will only see text first. To see proper message in Outlook Express, please select menu "View" --> "Message in HTML" and you will get the formatted text with embedded messages.
I used the following code snippet for the conversion (similar to yours). Please also see the attached images of eml file, before and after viewing in HTML format.
// step-1 - doc --> mht using Aspose.Words
string strDocFile = @"E:\Data\Aspose\temp\MsgFromMht\MhtmlSmtpMailerTest.doc";
string strEmlFile = @"E:\Data\Aspose\temp\MsgFromMht\NewEml.eml";
string strMsgFile = @"E:\Data\Aspose\temp\MsgFromMht\NewMsg.msg";
Document doc = new Document(strDocFile);
MemoryStream stream = new MemoryStream();
doc.Save(stream,
SaveFormat.Mhtml);
// step-2 - mht --> eml using Aspose.Network
MailMessage eml = MailMessage.Load(stream, MessageFormat.Mht);
eml.Save(strEmlFile,
MailMessageSaveType.EmlFormat);
// step-3 - eml --> msg using Aspose.Network
eml.Save(strMsgFile,
MailMessageSaveType.OutlookMessageFormatUnicode);
stream.Close();
Best Regards,
Saqib Razzaq
Support Developer, Aspose Sialkot Team
http://www.aspose.com
Your File Format Experts