Skip to main content

Save email as MSG

Save an email, with its recipients, HTML body and attachments, as an Outlook .msg file that opens in Outlook.

Command in the Microsoft 365 toolkit · id ooa.microsoft365/save_mail_as_msg · 6 inputs (2 required), 2 outputs

Inputs​

InputTypeRequiredDefaultWhat it is
Access tokenCredentialNoMicrosoft Graph access token from the vault; or leave it empty and choose a connection that signs in, which gets and renews the token.
IDStringYesEmail id.
Local pathFileYesWhere to save the .msg file; a path ending in / or an existing folder gets a file named after the subject.
OverwriteBooleanNotrueReplace an existing file; when false a number such as (2) is added to the name.
MailboxStringNomeMailbox: me, or a user's email address (needs application permission).
Endpoint addressStringNohttps://graph.microsoft.com/v1.0Graph endpoint; change only for national clouds or testing.

Outputs​

OutputTypeWhat it is
pathFileSaved local path.
attachmentsNumberNumber of attachments saved in the file.