Download attachment
download_attachmentDownload an email attachment by filename or part ID, returning base64-encoded content for files up to 5MB. Use part ID for duplicate filenames.
Instructions
Download an email attachment by filename or part id. First use get_email to see available attachments with their filenames and partIds (partId is unambiguous — use it for duplicate filenames and inline cid images). Returns base64-encoded content for files ≤5MB. saveToDownloadDir is unavailable — no attachment download directory is configured on this server.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Email ID (UID) from list_emails or get_email | |
| partId | No | MIME part id from get_email metadata (takes precedence over filename) | |
| saveAs | No | Filename to save as under the download directory (basename only, no path separators). Only used with saveToDownloadDir; defaults to the attachment’s own filename. | |
| account | Yes | Account name from list_accounts | |
| mailbox | No | Mailbox containing the email | INBOX |
| filename | No | Exact attachment filename (from get_email metadata) | |
| saveToDownloadDir | No | Write the attachment to the server-configured download directory instead of returning it base64-encoded. Fails if no download directory is configured. |