Yesterday's draft sits quietly in your Drafts folder. Today you send — the message actually leaves your outbox. What do you think changes in the params?
The API needs a recipient now. Subject and body aren't enough — it has to know who's getting the email.
Exactly. Action.GMAIL_SEND_EMAIL takes a recipient_email alongside subject and body. The response confirms the send with the new message's id and labels (SENT is usually there):
result = toolset.execute_action(Action.GMAIL_SEND_EMAIL, {
"recipient_email": "me@example.com",
"subject": "Test from Python",
"body": "Hello.",
})Sending to yourself is a nice trick — the message arrives in my own inbox so I can confirm it worked?
That's the safest way to verify a send action from code. You see the delivered message in your inbox within seconds. Wrap the call in a named function so any workflow can reuse it:
def send_email(recipient: str, subject: str, body: str) -> dict:
result = toolset.execute_action(Action.GMAIL_SEND_EMAIL, {
"recipient_email": recipient,
"subject": subject,
"body": body,
})
return resultIs this undoable? If my function sends to the wrong address, can I recall it?
No. Unlike drafts, a sent email leaves your server immediately. That is why write actions always deserve an extra check before they run — pair this function with a confirmation step in real workflows, or use the draft action first and only send when something approves it.
So after this, my Python can fully operate Gmail — count, read, search, draft, send. That covers every verb a human uses?
Every verb a human uses on the Gmail UI now has a Python twin in your head. Week 2 moves the same pattern to Calendar and Tasks.
TL;DR: GMAIL_SEND_EMAIL takes a recipient, subject, body — and the message leaves immediately.
{"recipient_email": ..., "subject": ..., "body": ...}id, threadId, labelIds (includes SENT)| Action | Effect |
|---|---|
GMAIL_CREATE_EMAIL_DRAFT | saves to Drafts, no delivery |
GMAIL_SEND_EMAIL | delivers immediately, shows up in recipient inbox |
Pair send actions with a review step when the recipient is anyone but you.
Yesterday's draft sits quietly in your Drafts folder. Today you send — the message actually leaves your outbox. What do you think changes in the params?
The API needs a recipient now. Subject and body aren't enough — it has to know who's getting the email.
Exactly. Action.GMAIL_SEND_EMAIL takes a recipient_email alongside subject and body. The response confirms the send with the new message's id and labels (SENT is usually there):
result = toolset.execute_action(Action.GMAIL_SEND_EMAIL, {
"recipient_email": "me@example.com",
"subject": "Test from Python",
"body": "Hello.",
})Sending to yourself is a nice trick — the message arrives in my own inbox so I can confirm it worked?
That's the safest way to verify a send action from code. You see the delivered message in your inbox within seconds. Wrap the call in a named function so any workflow can reuse it:
def send_email(recipient: str, subject: str, body: str) -> dict:
result = toolset.execute_action(Action.GMAIL_SEND_EMAIL, {
"recipient_email": recipient,
"subject": subject,
"body": body,
})
return resultIs this undoable? If my function sends to the wrong address, can I recall it?
No. Unlike drafts, a sent email leaves your server immediately. That is why write actions always deserve an extra check before they run — pair this function with a confirmation step in real workflows, or use the draft action first and only send when something approves it.
So after this, my Python can fully operate Gmail — count, read, search, draft, send. That covers every verb a human uses?
Every verb a human uses on the Gmail UI now has a Python twin in your head. Week 2 moves the same pattern to Calendar and Tasks.
TL;DR: GMAIL_SEND_EMAIL takes a recipient, subject, body — and the message leaves immediately.
{"recipient_email": ..., "subject": ..., "body": ...}id, threadId, labelIds (includes SENT)| Action | Effect |
|---|---|
GMAIL_CREATE_EMAIL_DRAFT | saves to Drafts, no delivery |
GMAIL_SEND_EMAIL | delivers immediately, shows up in recipient inbox |
Pair send actions with a review step when the recipient is anyone but you.
Create a free account to get started. Paid plans unlock all tracks.