Load Email document with options
Leave feedback
GroupDocs.Conversion provides EmailLoadOptions to give you control over how the source email document will be processed. The following options could be set:
- setFormat specifies the document type is auto-detected during loading, however, you can specify explicitly the type of the source email document. Available options are: Msg, Eml, Emlx, Pst, Ost, Vcf, Mht.
- setDisplayHeader specifies option to display or hide the email header.
- setDisplayFromEmailAddress specifies option to display or hide “from” email address.
- setDisplayEmailAddress specifies option to display or hide email address
- setDisplayToEmailAddress specifies option to display or hide “to” email address.
- setDisplayCcEmailAddress specifies option to display or hide “Cc” email address.
- setDisplayBccEmailAddress specifies option to display or hide “Bcc” email address.
The following code snippet shows how to convert an Email document and control the visibility of the fields:
const outputPath = "ConvertEmailWithAlteringFieldsVisibility.pdf"
const loadOptions = new groupdocs.conversion.EmailLoadOptions();
loadOptions.setDisplayHeader(false);
loadOptions.setDisplayFromEmailAddress(false);
loadOptions.setDisplayToEmailAddress(false);
loadOptions.setDisplayEmailAddress(false);
loadOptions.setDisplayCcEmailAddress(false);
loadOptions.setDisplayBccEmailAddress(false);
loadOptions.setConvertOwned(false);
const converter = new groupdocs.conversion.Converter("sample.msg", loadOptions)
const convertOptions = new groupdocs.conversion.PdfConvertOptions()
console.log(`Email document converted successfully to ${outputPath} (with altering fields visibility)`)
converter.convert(outputPath, convertOptions)
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.