create_draft
Creates a Mail draft and opens it for review without sending, so you can check recipients, subject, and body before sending.
Instructions
Create a Mail draft and OPEN it for you to review and send — it NEVER sends on
its own. to a recipient address. Returns a locator dict ({"created", "subject",
"mailbox", "from", "note"}) — a freshly opened compose window has no stable id
yet, so this says where to find it (Drafts) instead of fabricating one; save it
and drafts() resolves it by its stable message-id. If the create FAILS partway,
Mail may still leave a stray autosaved draft behind (#133 — its autosave is
asynchronous and cannot be suppressed); drafts() + delete_draft() clear it.
A new draft is unthreaded; it is sent from from_address (an address one of
Mail's accounts owns, matched case-insensitively, Name <addr> accepted) or
Mail's default account.
An address no account owns is refused before Mail builds anything — Mail would
otherwise use its default account silently. To answer a message use
mail_reply, which is threaded and sent from the account that received it.
THE AUTOSAVE WINDOW: Mail stamps the Message-ID only when it autosaves the draft,
~10-15 SECONDS after this returns — asynchronously, and nothing can hurry it. So
drafts() called immediately shows nothing. That is normal. Wait for the window,
then drafts() resolves it. Do NOT retry this call because the draft has not
appeared: you get two drafts and the first one still arrives.
Additive (creates a draft; does not send/modify/delete); needs Automation access
for Mail (the ownership read is Automation too).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | ||
| body | No | ||
| subject | No | ||
| from_address | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||