Free Support Forum - aspose.com

HTML mail when converted in MSG format

I have created a HTML mail through Microsoft Outlook having body, attachment and some embedded images in the mail body itself and save that in .EML format. Later on I load the mail through Aspose.Network.Mail.MailMessage.Load() method. After loading I used .save() method to save the mail in .MSG format.

But when I opened the .MSG file I am not able to see the embedded images. Instead of getting the images as embedded image I am getting the image as attachment... Also I am not able to see the body of the mail in the .MSG file.

I dont want to do anything in between Load() and Save() Aspose API call and all the necessary things should be taken care by Aspose.Email internally when it is going to save the mail in .MSG format. Aspose.Email should be able to detect that the particular mail is of HTML format and it should automatically fill the necessary fields before converting it to .MSG format.

Regards,

Atul

Hi Atul,


Thank you for your inquiry.

First of all, please upgrade to Aspose.Email for .NET. The code snippet you shared, points out that you are still using Aspose.Network API.

Secondly, please share your source code and sample EML file for our review. I suspect there should be something wrong with your source code. For your reference, you need to tell the API that you are loading an EML file by specifying MessageFormat in Load method. Similarly you need to explicitly mention the save format by specifying the MailMessageSaveType in Save method.

Regards,

Hi Babar,

Actually I am using latest Aspose.Email version 1.1 for .NET. The code that I send to you was old one.

So following is the code that I used to convert an .eml file (mail is in .html format) to .MSG format:-

Aspose.Email.Mail.MailMessage message = Aspose.Email.Mail.MailMessage.Load(“HTML_Mail_With_Embedded_Images.eml”, MessageFormat.Eml");

message.Save(“HTML_Mail_With_Embedded_Images.eml”, MessageFormat.msg", MailMessageSaveType.OutlookMessageFormatUnicode);


Thanks,
Atul

Hi Atul,


Thank you for the source code. The code seems to the OK. Please also attach your problematic sample EML file.