Fluxmail

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

NameRequiredTypeDetails
idempotencyKeyYesstringReuse this key when retrying the same delivery
draftIdNostring or nullSend this existing draft Minimum length: 1. Maximum length: 512.
accountIdNostring or nullAccount to operate on. Optional when exactly one account is connected. Minimum length: 1. Maximum length: 512.
fromNostring or nullConnected address or an available send-as address Format: email.
toNoarray of string or nullRecipients, each "Name a@x.com" or "a@x.com"
ccNoarray of string or nullRecipients, each "Name a@x.com" or "a@x.com"
bccNoarray of string or nullRecipients, each "Name a@x.com" or "a@x.com"
subjectNostring or nullDefaults to "Re: ..." when replying Maximum length: 998.
bodyTextNostring or nullPlain-text body. Line breaks appear in the sent email. Keep each prose paragraph on one continuous line and separate paragraphs with blank lines.
bodyHtmlNostring or nullHTML body
replyToMessageIdNostring or nullMessage 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.
replyAllNoboolean or nullWith replyToMessageId: reply to all original recipients
timeZoneNostring or nullWith 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.
quoteOriginalNoboolean or nullWith replyToMessageId: set to false to leave the original message out of the reply. Defaults to true.
attachmentsNoarray of object or nullNone
sendAtNostring or nullSchedule 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": {
                "type": "string",
                "minLength": 1,
                "maxLength": 255
              },
              "mimeType": {
                "type": "string",
                "minLength": 1,
                "maxLength": 255
              },
              "content": {
                "type": "string",
                "description": "base64"
              },
              "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": [
              "filename",
              "mimeType",
              "content"
            ],
            "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

On this page