App Logo
mail.google.com

Send a Gmail draft

Send an existing Gmail draft, identified by the id the drafts listing gives you. This delivers a real message and cannot be undone, so the draft's recipients and subject are read and reported back before and with the send, and a draft with no recipient is refused rather than attempted. Success is confirmed two ways: the draft leaves Drafts and the same conversation turns up in Sent. The conversation id is returned and is the same before and after sending, so the message can be found again afterwards.

Input

draftId required

The draft's current id, as returned by the drafts listing. Gmail replaces a draft's id every time it is saved, so use a freshly listed one.

Output

sent required

True when the message was actually sent. Always true on success — the script fails loudly instead of returning false.

subject required

Subject of the message that was sent. Empty when the draft had no subject.

threadId required

Conversation id, unchanged by sending, so the sent message can be located afterwards.

account_used required

The Gmail account the message was sent from, read from the session rather than assumed.

verified_on_page required

True when the conversation was found in Sent afterwards, which is what proves the message went.

recipientsDisplay required

The recipients exactly as the compose window lists them — display names with the domain, which is what Gmail renders there. Full email addresses are not available on this surface, so none are invented; this is reported so the delivery is still auditable.

sender optional

The from address as the compose window shows it, read off the message itself rather than the browser session.

leftDrafts optional

Whether the draft had also disappeared from Drafts by the time this was checked. Informational: sending always removes it, but the list does not always repaint immediately, so false here does not mean the send failed.

foundInSent optional

Whether the conversation was found in Sent afterwards. This is the proof of sending.

previousDraftId optional

The draft id that was sent and therefore no longer exists as a draft.

Start building not clicking