We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Message headers to HTML


Is there any way to export message headers to html output?

Hi Acton,

You can write the email headers to output Html using the HtmlSaveOptions class. Please refer to the following sample code for this purpose and let us know if you need further assistance in this regard.

Sample Code:

MailMessage eml = MailMessage.Load(fileName);

HtmlSaveOptions options = SaveOptions.DefaultHtml;
options.EmbedResources = false;
options.HtmlFormatOptions = HtmlFormatOptions.WriteHeader | HtmlFormatOptions.WriteCompleteEmailAddress; //save the message headers to output HTML using the formatting options
eml.Save(outFileName, options);