integrations.gmail_send
Gmail Send (integrations.gmail_send)
Send email through the connected Gmail account — one message per input item, with the item's files as attachments.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
to | expression | — | Recipient(s); comma-separate for several. |
subject | expression | — | Unicode/emoji safe. |
body_text | expression | — | Plain-text body. |
body_html | expression | — | Optional; when set the mail goes out as multipart/alternative (text + HTML). |
attachments | list | [] | $binary field names to attach. Empty = attach every file on the item, any type. |
Credential: oauth2_google (gmail.send scope).
Behavior
Each input item builds a standards-compliant MIME message and posts it to
messages.send. The output item is Gmail's response (id, threadId) with
paired_item lineage.
form (file upload) → gmail_send (to: {{ $json.email }}) # file arrives attached
Quirks & tips
- Header injection is refused. A
to/subjectvalue smuggling a newline (a@b.c\nBcc: …) fails the node before anything is sent — pinned by test. - A named-but-missing attachment field is a clear error (and nothing sends); the attach-everything default simply attaches nothing when the item has no files.
- An empty
tofails the item with its index — check your expression when fanning out over items. - Sends are sequential, one API call per item — Gmail's own rate limits apply for large batches.
- The sender is always the connected account (
users/me); custom From headers aren't supported.
Related
- Error Trigger — the classic "workflow failed → email me" pair.
- Create File — build a csv/xlsx to attach.
- Google Drive — store the file instead of mailing it.