save_draft
Save an email as a draft without sending it, stored in the Drafts folder. Optionally replace an existing draft atomically to avoid losing the original.
Instructions
Save an email as a draft without sending it. The draft is placed in the user's \Drafts special-use folder (resolved at runtime; falls back to literal Drafts if no annotation). The destination is intentionally not caller-controlled — prior versions accepted an arbitrary folder parameter that allowed planting \Draft-flagged messages in INBOX or other paths, which was confusing to anyone scanning the mailbox.
Pass replaceDraftUid to atomically replace a previous draft instead of appending a new one — the new draft is APPENDed first, then (only on success) the old one is deleted, so a failed append leaves your original draft intact.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | Recipient email address(es), comma-separated | |
| subject | Yes | Email subject line | |
| body | No | Email body content (plain text or HTML). Required unless `markdownBody` is provided. | |
| isHtml | No | Whether `body` contains HTML content | |
| markdownBody | No | Markdown source — rendered to HTML before saving. Mutually exclusive with `body`/`isHtml`. | |
| sanitizeHtml | No | Run the HTML body through a conservative allowlist (strips scripts, event handlers, inline styles, remote `<img>` beacons) before APPEND. Default `true` for safer-by-default drafts. No-op on plain-text. | |
| cc | No | CC recipient(s), comma-separated | |
| bcc | No | BCC recipient(s), comma-separated | |
| replyTo | No | Reply-To email address. Note: Proton SMTP may rewrite or ignore values that don't match authenticated identities. | |
| fromName | No | Display name for the From field. Rejects values containing `@` by default to prevent display-name-as-address spoofing — pass `allowAddressLikeFromName: true` to override. | |
| allowAddressLikeFromName | No | Opt-in escape valve for `fromName` containing `@`. Default false. | |
| replaceDraftUid | No | Optional UID of a previous draft in the Drafts folder to atomically replace. The new draft is APPENDed first; the old one is deleted only after the append succeeds, so a failed append never destroys the original. Errors if the UID doesn't exist in Drafts. |