Open Eml file in browser

Hi Team


I like to know whether using aspose.email is it possible to display EML file in web browser. Or you have any other component to achieve this functionality.

Thanks

Hi,


Thank you for contacting Aspose Support team.

There is no viewer component of Aspose.Email API that can be used to display EML file. However, you can use MailMessage class to load and convert EML files to HTML/MHTML that can further be displayed in a browser. Please have a look at the following sample code and our documentation article for further examples in this regard and let us know if we can be of any additional help to you in this regard.

Sample Code:

MailMessage message = MailMessage.Load(“sample.eml”);

message.Save(outFileName, SaveOptions.DefaultHtml);