Load Email document with options

View as MarkdownMarkdown

Set up your AI agent

Give your coding agent live access to the GroupDocs documentation and API reference through the GroupDocs Docs MCP server — no install, no API key. Learn more

claude mcp add --transport http groupdocs-docs https://docs.groupdocs.com/mcp

Also process documents locally

The GroupDocs.Conversion MCP server lets your agent work with files on your machine; they are never uploaded. It needs the .NET 10 SDK or Docker.

claude mcp add groupdocs-conversion -- dnx GroupDocs.Conversion.Mcp --yes
Folders, licensing and more →

GroupDocs.Conversion provides EmailLoadOptions to give you control over how the source email document will be processed. The following options could be set:

Control fields visibility

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)