mail_send_draft
Send a saved iCloud Mail draft exactly as written, then move it to Trash; if approval is required, queue it for the owner instead.
Instructions
Send a draft already saved in Drafts exactly as it stands (its own recipients, subject, body and attachments), then move the draft to Trash.
Use when: the owner has reviewed a draft and says to send it. Not for editing it first (use mail_update_draft, then send the uid it returns), composing new mail (use mail_send_message), or answering a message (use mail_reply_to_message). Parameters: uid and uidvalidity come from mail_search_messages(folder='Drafts') or from mail_update_draft's result; after an update the old uid is gone. Omit folder for Drafts; a message in any other folder must carry the \Draft flag or it is refused. From, Date and Message-ID are filled in when the draft lacks them. Behavior:
The same gates as mail_send_message: recipient cap, SEND_ALLOWLIST and owner approval (on by default).
Under approval it is queued, NOT sent, and the draft stays in Drafts until the owner approves.
A draft is queued once: sending the same uid again returns the entry already waiting (already_queued=true), never a second copy.
On a local server it returns already_a_draft and the owner sends it from Mail.
Once sent, a copy goes to Sent and the draft moves to Trash. Bcc recipients receive it without being shown to the others. Returns: status sent (recipients, message_id, subject, to, cc, saved_to, draft_moved_to_trash, or draft_left_in_place if the Trash move failed), queued_for_owner_approval (sent=false, outbox_id, approve_at: tell the owner; already_queued=true on a repeat), or already_a_draft. Errors: 'is not a saved draft', 'No message with uid' or out-of-date uids (search Drafts again), and the recipient and SMTP errors of mail_send_message.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uid | Yes | The draft's uid in Drafts (from mail_search_messages(folder='Drafts')). | |
| folder | No | Where the draft is; default Drafts. | Drafts |
| uidvalidity | Yes | The 'uidvalidity' from the result the uids came from (required: a renumbered folder is refused, not misread). |