send_email
Send an email from a connected mailbox. There are three modes: direct (to, subject and body), an existing draft (draftId), or a reply (replyToMessageId, optionally with replyAll) that takes its recipients, subject and threading from the original and quotes it below the body unless quoteOriginal is false. Repeating a successful send with the same idempotencyKey and arguments returns the saved result instead of sending again. Reusing a key with different arguments, or after a failed or uncertain send, returns an error. Add sendAt to any mode to schedule the message instead of sending it now. Confirm with the user when the intent is ambiguous. Scheduled mail is delivered by fluxmail serve or fluxmail scheduled run using the same store. Stdio does not deliver schedules. Overdue mail may send when a worker starts.
Send an email from a connected mailbox. There are three modes: direct (to, subject and body), an existing draft (draftId), or a reply (replyToMessageId, optionally with replyAll) that takes its recipients, subject and threading from the original and quotes it below the body unless quoteOriginal is false. Repeating a successful send with the same idempotencyKey and arguments returns the saved result instead of sending again. Reusing a key with different arguments, or after a failed or uncertain send, returns an error. Add sendAt to any mode to schedule the message instead of sending it now. Confirm with the user when the intent is ambiguous. Scheduled mail is delivered by fluxmail serve or fluxmail scheduled run using the same store. Stdio does not deliver schedules. Overdue mail may send when a worker starts.
Permissions
Required capabilities: mail.send.
Inputs
| Name | Required | Type | Details |
|---|---|---|---|
idempotencyKey | Yes | string | Reuse this key when retrying the same delivery |
draftId | No | string or null | Send this existing draft Minimum length: 1. Maximum length: 512. |
accountId | No | string or null | Account to operate on. Optional when exactly one account is connected. Minimum length: 1. Maximum length: 512. |
from | No | string or null | Connected address or an available send-as address Format: email. |
to | No | array of string or null | Recipients, each "Name a@x.com" or "a@x.com" |
cc | No | array of string or null | Recipients, each "Name a@x.com" or "a@x.com" |
bcc | No | array of string or null | Recipients, each "Name a@x.com" or "a@x.com" |
subject | No | string or null | Defaults to "Re: ..." when replying Maximum length: 998. |
bodyText | No | string or null | Plain-text body. Line breaks appear in the sent email. Keep each prose paragraph on one continuous line and separate paragraphs with blank lines. |
bodyHtml | No | string or null | HTML body |
replyToMessageId | No | string or null | Message being replied to; threads correctly, quotes it below the body and computes recipients if "to" is omitted. To continue a conversation, reply to the first message get_thread returns with order newest Minimum length: 1. Maximum length: 512. |
replyAll | No | boolean or null | With replyToMessageId: reply to all original recipients |
timeZone | No | string or null | With replyToMessageId: IANA time zone, such as America/New_York, for the date above the quoted message. Defaults to the time zone setting. Minimum length: 1. Maximum length: 100. |
quoteOriginal | No | boolean or null | With replyToMessageId: set to false to leave the original message out of the reply. Defaults to true. |
attachments | No | array of object or null | None |
attachmentFiles | No | array of object or null | Files to attach from the attachment folder, read by Fluxmail instead of sent as base64. Prefer this to attachments for files on this computer. They are added to the attachments. |
sendAt | No | string or null | Schedule delivery instead of sending now: ISO 8601 with timezone offset or Z (e.g. 2026-07-11T09:00:00-07:00), at most a year ahead. Fluxmail saves the message as a draft in the mailbox and sends that draft at the scheduled time. Returns a scheduleId for list/cancel. Format: date-time. |
{
"type": "object",
"properties": {
"idempotencyKey": {
"type": "string",
"pattern": "^[\\x21-\\x7e]{1,255}$",
"description": "Reuse this key when retrying the same delivery"
},
"draftId": {
"description": "Send this existing draft",
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 512
},
{
"type": "null"
}
]
},
"accountId": {
"description": "Account to operate on. Optional when exactly one account is connected.",
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 512
},
{
"type": "null"
}
]
},
"from": {
"description": "Connected address or an available send-as address",
"anyOf": [
{
"type": "string",
"format": "email"
},
{
"type": "null"
}
]
},
"to": {
"description": "Recipients, each \"Name <a@x.com>\" or \"a@x.com\"",
"anyOf": [
{
"maxItems": 100,
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 512
},
"description": "Recipients, each \"Name <a@x.com>\" or \"a@x.com\""
},
{
"type": "null"
}
]
},
"cc": {
"description": "Recipients, each \"Name <a@x.com>\" or \"a@x.com\"",
"anyOf": [
{
"maxItems": 100,
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 512
},
"description": "Recipients, each \"Name <a@x.com>\" or \"a@x.com\""
},
{
"type": "null"
}
]
},
"bcc": {
"description": "Recipients, each \"Name <a@x.com>\" or \"a@x.com\"",
"anyOf": [
{
"maxItems": 100,
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 512
},
"description": "Recipients, each \"Name <a@x.com>\" or \"a@x.com\""
},
{
"type": "null"
}
]
},
"subject": {
"description": "Defaults to \"Re: ...\" when replying",
"anyOf": [
{
"type": "string",
"maxLength": 998
},
{
"type": "null"
}
]
},
"bodyText": {
"description": "Plain-text body. Line breaks appear in the sent email. Keep each prose paragraph on one continuous line and separate paragraphs with blank lines.",
"type": [
"string",
"null"
]
},
"bodyHtml": {
"description": "HTML body",
"type": [
"string",
"null"
]
},
"replyToMessageId": {
"description": "Message being replied to; threads correctly, quotes it below the body and computes recipients if \"to\" is omitted. To continue a conversation, reply to the first message get_thread returns with order newest",
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 512
},
{
"type": "null"
}
]
},
"replyAll": {
"description": "With replyToMessageId: reply to all original recipients",
"type": [
"boolean",
"null"
]
},
"timeZone": {
"description": "With replyToMessageId: IANA time zone, such as America/New_York, for the date above the quoted message. Defaults to the time zone setting.",
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 100
},
{
"type": "null"
}
]
},
"quoteOriginal": {
"description": "With replyToMessageId: set to false to leave the original message out of the reply. Defaults to true.",
"type": [
"boolean",
"null"
]
},
"attachments": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"properties": {
"filename": {
"description": "Required with content",
"type": "string",
"minLength": 1,
"maxLength": 255
},
"mimeType": {
"description": "Required with content",
"type": "string",
"minLength": 1,
"maxLength": 255
},
"content": {
"description": "base64",
"type": "string"
},
"contentId": {
"description": "With content: Content-ID for an inline image, referenced from bodyHtml as cid:<contentId>",
"type": "string",
"minLength": 1,
"maxLength": 255
},
"disposition": {
"description": "With content: defaults to attachment",
"type": "string",
"enum": [
"inline",
"attachment"
]
},
"messageId": {
"description": "Instead of content: a message in this mailbox with the attachment to include. Requires mail.read",
"type": "string",
"minLength": 1,
"maxLength": 512
},
"attachmentId": {
"description": "With messageId: the attachment ID from get_email",
"type": "string",
"minLength": 1,
"maxLength": 512
}
},
"additionalProperties": false,
"description": "Give content with a filename and mimeType, or messageId and attachmentId"
}
},
{
"type": "null"
}
]
},
"attachmentFiles": {
"description": "Files to attach from the attachment folder, read by Fluxmail instead of sent as base64. Prefer this to attachments for files on this computer. They are added to the attachments.",
"anyOf": [
{
"maxItems": 20,
"type": "array",
"items": {
"type": "object",
"properties": {
"path": {
"type": "string",
"minLength": 1,
"maxLength": 1024,
"description": "Path relative to the attachment folder"
},
"filename": {
"description": "Defaults to the file name",
"type": "string",
"minLength": 1,
"maxLength": 255
},
"mimeType": {
"description": "Defaults to the type for the file extension",
"type": "string",
"minLength": 1,
"maxLength": 255
},
"contentId": {
"description": "Content-ID for an inline image, referenced from bodyHtml as cid:<contentId>",
"type": "string",
"minLength": 1,
"maxLength": 255
},
"disposition": {
"description": "Defaults to attachment",
"type": "string",
"enum": [
"inline",
"attachment"
]
}
},
"required": [
"path"
],
"additionalProperties": false
}
},
{
"type": "null"
}
]
},
"sendAt": {
"description": "Schedule delivery instead of sending now: ISO 8601 with timezone offset or Z (e.g. 2026-07-11T09:00:00-07:00), at most a year ahead. Fluxmail saves the message as a draft in the mailbox and sends that draft at the scheduled time. Returns a scheduleId for list/cancel.",
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
]
}
},
"required": [
"idempotencyKey"
],
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false
}Last updated