Free Support Forum - aspose.com

Export EML- MSG to image (png etc)

Hello,

I wish to know if it is possible to export a loaded .msg or .eml file to an image? like png or jpeg. Showing its mail body and probably inline attachments?

Thanks,
Jay

Hi Jay,


Thank you for writing to us.

I am afraid to inform that conversion of EML/MSG files to PNG or JPEG image types is not supported at present by Aspose.Email. Currently, the API can export to XPS and TIFF formats only using the following code sample. We have implementation of conversion to PNG in our development plans, but unfortunately, that can’t be met in the near future due to some other priority tasks and functional complexities. We appreciate your understanding in this regard.


MapiMessage message = MapiMessage.FromFile(“E20130121000020.msg”);

//Instantiate an instance of MailPrinter
var printer = new Aspose.Email.Printing.MailPrinter();

//Set the MessageFormattingFlags to none to display only the message body
printer.FormattingFlags = Aspose.Email.Printing.MessageFormattingFlags.None;

//Print the email to an XPS file
printer.Print(message, “OutputXps.xps”, Aspose.Email.Printing.PrintFormat.XPS);

//Print the email to a TIFF file
printer.Print(message, “OutputTiff.tiff”, Aspose.Email.Printing.PrintFormat.Tiff);