create_rich_email_draft
Generate rich-text email drafts as .eml files for reliable HTML rendering in Apple Mail, with options to open, save, and customize recipients and content.
Instructions
Create a rich-text email draft by generating an unsent .eml message and optionally opening it in Mail.
This is the preferred path for HTML or richly formatted emails because Mail reliably renders .eml
content, while setting raw HTML through AppleScript often stores the literal markup instead.
Args:
account: Account name to use for the sender identity (e.g., "Work", "Oracle")
subject: Subject line for the draft (optional; defaults to empty)
to: Optional recipient email address(es), comma-separated for multiple
text_body: Optional plain-text body. If omitted but html_body is provided, a fallback plain body is generated.
html_body: Optional HTML body. If omitted but text_body is provided, a basic HTML wrapper is generated.
cc: Optional CC recipients, comma-separated for multiple
bcc: Optional BCC recipients, comma-separated for multiple
output_path: Optional path for the generated .eml file
open_in_mail: If True, open the generated .eml in Mail (default: True)
save_as_draft: If True, ask Mail to save the opened compose window into Drafts (default: False)
Returns:
Confirmation with the generated .eml path, missing details, and Mail-open/save status
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| account | Yes | ||
| subject | No | ||
| to | No | ||
| text_body | No | ||
| html_body | No | ||
| cc | No | ||
| bcc | No | ||
| output_path | No | ||
| open_in_mail | No | ||
| save_as_draft | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |