save_to_mailbox
Compose an email and save it directly to an IMAP folder like Drafts, with full support for recipients, subject, body, attachments, and flags. Works without SMTP configuration.
Instructions
Compose an email and save it to an IMAP folder (e.g., Drafts). Shares recipient, body, attachment, and threading parameters with send_email; adds mailbox and flags, and does not support reply_to. Default folder is Drafts with \Draft and \Seen flags. Pure IMAP operation — works without SMTP configuration. An ambiguous APPEND is reported as unknown and is not retried automatically.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cc | No | A list of CC email addresses. | |
| bcc | No | A list of BCC email addresses. | |
| body | Yes | The body of the email. | |
| html | No | Whether the email body is HTML (True) or plain text (False). | |
| flags | No | IMAP flags to set on the message. Defaults to ['\Draft', '\Seen']. Common flags: '\Draft', '\Seen', '\Flagged'. | |
| mailbox | No | The IMAP folder to save to (e.g., 'Drafts', 'INBOX.Drafts', 'Templates'). | Drafts |
| subject | Yes | The subject of the email. | |
| recipients | Yes | A list of recipient email addresses. | |
| references | No | Space-separated Message-IDs for the thread chain. | |
| attachments | No | A list of file paths to attach. Relative paths are resolved against the server process working directory; absolute paths are recommended. | |
| in_reply_to | No | Message-ID of the email being replied to. Enables proper threading in email clients. | |
| account_name | Yes | The name of the email account. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |