On this page
Sommatic Docs
Open portal

Send Email (SMTP)

Send emails via SMTP server.

View as Markdown
Open in
Input and output Available io.smtp Version 1.0.0 Execution: async

Sends one email through an SMTP server described by a credential and returns the delivery report of the relay.

How it works

  1. Resolves the config. connection_id, to, subject, text and html fall back to the same keys of the incoming payload; connection_id, to and subject are required.
  2. Resolves the credential: host, port (default 587), secure (default false) and from from its config; username (or user) and password (or pass) from its secret. from defaults to the username.
  3. Opens the SMTP transport, authenticating only when a user is present.
  4. Sends the message with from, to, subject, text and html, and returns the relay report as { result } through out.

In a workflow

The node as it appears in a workflow file (draft_nodes[]), and the envelope of a successful run.

{
  "node_id": "node-send-alert",
  "label": "Send alert email",
  "operator_slug": "io.smtp",
  "operator_version": "1.0.0",
  "config": {
    "connection_id": "pi-credential-xxxx",
    "to": "[email protected]",
    "subject": "Order {{ $json.order_id }} requires review",
    "text": "Order {{ $json.order_id }} exceeded the approval limit.",
    "html": "<p>Order <strong>{{ $json.order_id }}</strong> exceeded the approval limit.</p>"
  }
}

Configuration

connection_id string Required

Credential for the SMTP server. Accepts credentials of type `basic-auth` (username + password + host + port) or `connection-string` (smtp:// / smtps:// URI).

to string Required

Recipient email(s)

subject string Required
text string Optional

Text body

html string Optional

HTML body

Behaviour in the code

What the implementation does with these keys beyond what the schema says.

connection_id
Use a basic-auth credential with host, port, secure and from in its config. A connection-string secret is not parsed when it comes from a stored credential. A value that starts with { or contains :// or @ is parsed in place (a JSON object, or an smtp://user:pass@host:port URI) for local tests.
html
Sent together with text when both are set; mail clients show the HTML part.

Output ports

out default

The relay accepted the message. result is the mail library's send report: accepted, rejected, envelope, messageId, response, plus timing fields.

Data
{
  "result": {
    "accepted": [
      "[email protected]"
    ],
    "rejected": [],
    "envelope": {
      "from": "[email protected]",
      "to": [
        "[email protected]"
      ]
    },
    "messageId": "<[email protected]>",
    "response": "250 2.0.0 OK queued"
  }
}
error

A required field is missing, the credential cannot be resolved, or the connection, login or send failed.

Data
{
  "error": "Invalid login: 535 5.7.8 Authentication credentials invalid"
}

In expressions

What a later node can read from this node's output with $("Send Email (SMTP)").item.json.<path> (write your node's label instead of Send Email (SMTP)). Editor marks the paths the workflow editor suggests under Previous Nodes (the output contract); Worker marks the paths the worker really returns through out, from the output shown in Ports.

ExpressionEditorWorker
$("Send Email (SMTP)").item.json.resultobject= {…}Send info
$("Send Email (SMTP)").item.json.result.acceptedarrayNot suggested by the editor= […] (1)—
$("Send Email (SMTP)").item.json.result.rejectedarrayNot suggested by the editor= […] (0)—
$("Send Email (SMTP)").item.json.result.envelopeobjectNot suggested by the editor= {…}—
$("Send Email (SMTP)").item.json.result.messageIdstringNot suggested by the editor= "<5f1c2a7e-8b1d-4a3e-9c0f-2d6e7b8a9c10@exampl…"—
$("Send Email (SMTP)").item.json.result.responsestringNot suggested by the editor= "250 2.0.0 OK queued"—

— Worker: The worker returns it but the editor does not suggest it: write it by hand. Keys inside objects can depend on your data or configuration (for example one key per label).

Errors

Message Port Cause and fix
to is required error No recipient. to accepts one address or several separated by commas. (connection_id is required and subject is required report the other required fields.)
Invalid login: <server response> error The server rejected the user or password. Providers that require app passwords need one stored in the credential.
<TLS or connection error> error secure does not match the port: use secure: true with 465 and secure: false with 587 (STARTTLS is negotiated automatically).

Input contract

connection_id string Required
to string Required
subject string Required
text string Optional
html string Optional

Output contract

result object Optional

Send info

Contracts (JSON Schema)

The definition exactly as the orchestrator declares it. All is the whole *.definition.js; compare it with the sections above to spot differences between the documentation and the schema. Use it to validate a node before you publish.

{
  "slug": "io.smtp",
  "name": "Send Email (SMTP)",
  "category": "io",
  "version": "1.0.0",
  "description": "Send emails via SMTP server.",
  "capabilities": [
    "email",
    "smtp",
    "communication"
  ],
  "config_schema": {
    "type": "object",
    "properties": {
      "connection_id": {
        "type": "string",
        "title": "SMTP Credential",
        "description": "Credential for the SMTP server. Accepts credentials of type `basic-auth` (username + password + host + port) or `connection-string` (smtp:// / smtps:// URI).",
        "ui_widget": "connection_picker",
        "ui_options": {
          "credential_types": [
            "basic-auth",
            "connection-string"
          ],
          "types": [
            "smtp"
          ]
        }
      },
      "to": {
        "type": "string",
        "description": "Recipient email(s)"
      },
      "subject": {
        "type": "string"
      },
      "text": {
        "type": "string",
        "description": "Text body"
      },
      "html": {
        "type": "string",
        "description": "HTML body"
      }
    },
    "required": [
      "connection_id",
      "to",
      "subject"
    ]
  },
  "input_contract_schema": {
    "type": "object",
    "properties": {
      "connection_id": {
        "type": "string"
      },
      "to": {
        "type": "string"
      },
      "subject": {
        "type": "string"
      },
      "text": {
        "type": "string"
      },
      "html": {
        "type": "string"
      }
    },
    "required": [
      "connection_id",
      "to",
      "subject"
    ]
  },
  "output_contract_schema": {
    "type": "object",
    "properties": {
      "result": {
        "type": "object",
        "description": "Send info"
      }
    }
  },
  "ports": [
    {
      "port_id": "out",
      "label": "Sent",
      "description": "Email accepted by relay",
      "is_default": true,
      "supports_condition": true
    },
    {
      "port_id": "error",
      "label": "Error",
      "description": "Sending failed",
      "is_default": false,
      "supports_condition": false
    }
  ],
  "execution_mode": "async",
  "required_resources": [],
  "compatible_worker_pools": [
    "standard-io"
  ],
  "tags": [
    "email",
    "communication"
  ],
  "is_stateful": false,
  "publisher": {
    "identity": "org_link_loom",
    "profile": {
      "name": "Link Loom",
      "verified": true,
      "url": "https://me.veripass.com/link-loom",
      "logo_url": null
    }
  }
}

Execution

Execution
async
Stateful
No
Credentials
Resolved on the server from connection_id; the secret never reaches the workflow.
Capabilities
emailsmtpcommunication
Tags
emailcommunication

Notes and limits

  • Attachments, cc, bcc and replyTo are not supported by this node.
  • out means the relay accepted the message, not that it reached the inbox. Not idempotent: every run sends a new email; there are no retries.

Reviewed against the orchestrator code · 31e874b · 2026-11-26

Install agent tools

Give your coding agent the official Sommatic AI docs: skills, the docs MCP server and Markdown pages, so it never has to scrape the site.

Skills only. They do not update by themselves; run it again to refresh.

npx skills add https://docs.sommatic.ai
How agents read these docs