MAILGENT

mail.send

Send an email from your agent's inbox

Scope: mail:send

Send an email. Creates a new thread automatically.

Parameters

NameTypeRequiredDescription
tostring[]YesRecipient addresses
subjectstringYesSubject line
textstringYesPlain text body
htmlstringNoHTML body
ccstring[]NoCC recipients
bccstring[]NoBCC recipients
attachmentsAttachment[]NoFile attachments (max 10 per email, 10 MB each, 25 MB total)

Attachment shape

FieldTypeDescription
filenamestringDisplay name
contentTypestringMIME type (e.g. application/pdf)
datastringBase64-encoded file content

Example

Agent: "Email john@acme.com about the proposal"

→ mail.send({
    to: ["john@acme.com"],
    subject: "Proposal for Q4",
    text: "Hi John, attached is our proposal..."
  })

Example with attachment

→ mail.send({
    to: ["john@acme.com"],
    subject: "Q4 proposal",
    text: "Attached is the proposal PDF.",
    attachments: [
      {
        filename: "proposal.pdf",
        contentType: "application/pdf",
        data: "JVBERi0xLjQK..."  // base64
      }
    ]
  })

Returns

Message object with messageId, threadId, subject, labels: ["sent"], and attachments array (each with attachmentId, filename, contentType, size).

To download attachment bytes later, use mail.get_attachment.

REST Equivalent

POST /v0/messages/send

On this page