send_gmail_message
Send an email via Gmail with support for HTML content, CC/BCC recipients, and replying to existing threads.
Instructions
Sends an email using the user's Gmail account. Supports both new emails and replies.
Args: to (str): Recipient email address. subject (str): Email subject. body (str): Email body content. body_format (Literal['plain', 'html']): Email body format. Defaults to 'plain'. cc (Optional[str]): Optional CC email address. bcc (Optional[str]): Optional BCC email address. user_google_email (str): The user's Google email address. Required. thread_id (Optional[str]): Optional Gmail thread ID to reply within. When provided, sends a reply. in_reply_to (Optional[str]): Optional Message-ID of the message being replied to. Used for proper threading. references (Optional[str]): Optional chain of Message-IDs for proper threading. Should include all previous Message-IDs.
Returns: str: Confirmation message with the sent email's message ID.
Examples: # Send a new email send_gmail_message(to="user@example.com", subject="Hello", body="Hi there!")
# Send an HTML email
send_gmail_message(
to="user@example.com",
subject="Hello",
body="<strong>Hi there!</strong>",
body_format="html"
)
# Send an email with CC and BCC
send_gmail_message(
to="user@example.com",
cc="manager@example.com",
bcc="archive@example.com",
subject="Project Update",
body="Here's the latest update..."
)
# Send a reply
send_gmail_message(
to="user@example.com",
subject="Re: Meeting tomorrow",
body="Thanks for the update!",
thread_id="thread_123",
in_reply_to="<message123@gmail.com>",
references="<original@gmail.com> <message123@gmail.com>"
)Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| user_google_email | Yes | ||
| to | Yes | Recipient email address. | |
| subject | Yes | Email subject. | |
| body | Yes | Email body content (plain text or HTML). | |
| body_format | No | Email body format. Use 'plain' for plaintext or 'html' for HTML content. | plain |
| cc | No | Optional CC email address. | |
| bcc | No | Optional BCC email address. | |
| thread_id | No | Optional Gmail thread ID to reply within. | |
| in_reply_to | No | Optional Message-ID of the message being replied to. | |
| references | No | Optional chain of Message-IDs for proper threading. | |
| dry_run | No | If True, returns a preview and does not send the email. Defaults to True. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |