imap_send_email
Compose and send a new email via SMTP with support for multiple recipients (to, cc, bcc), rich HTML content, and file attachments. A copy is saved to the Sent folder.
Instructions
Compose and send a NEW email via the account's SMTP server (a copy is saved to Sent unless disabled). Use for fresh outbound messages. To respond to an existing message use imap_reply_to_email (keeps threading); to pass a message on use imap_forward_email; to store without sending use imap_save_draft. Supports to/cc/bcc, text and/or HTML, and attachments by base64 content or by file path (see imap_upload_file for large files).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cc | No | CC recipients | |
| to | Yes | Recipient email address(es) | |
| bcc | No | BCC recipients | |
| body | No | Alias for 'text' (backward-compat with clients that pass 'body') | |
| html | No | HTML content | |
| text | No | Plain text content | |
| replyTo | No | Reply-to address | |
| subject | Yes | Email subject | |
| accountId | No | Account ID (from imap_list_accounts). Optional if accountName is given or only one account is configured. | |
| accountName | No | Account name instead of accountId. Optional if accountId is given or only one account is configured. | |
| attachments | No | Email attachments |