Send Email (SMTP)
Send emails via SMTP server.
Sends one email through an SMTP server described by a credential and returns the delivery report of the relay.
How it works
- Resolves the config.
connection_id,to,subject,textandhtmlfall back to the same keys of the incoming payload;connection_id,toandsubjectare required. - Resolves the credential:
host,port(default 587),secure(default false) andfromfrom its config;username(oruser) andpassword(orpass) from its secret.fromdefaults to the username. - Opens the SMTP transport, authenticating only when a user is present.
- Sends the message with
from,to,subject,textandhtml, and returns the relay report as{ result }throughout.
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>"
}
}{
"ok": true,
"data": {
"result": {
"accepted": [
"[email protected]"
],
"rejected": [],
"envelope": {
"from": "[email protected]",
"to": [
"[email protected]"
]
},
"messageId": "<[email protected]>",
"response": "250 2.0.0 OK queued"
}
},
"port": "out"
}Configuration
-
connection_idstring Required -
Credential for the SMTP server. Accepts credentials of type `basic-auth` (username + password + host + port) or `connection-string` (smtp:// / smtps:// URI).
-
tostring Required -
Recipient email(s)
-
subjectstring Required -
textstring Optional -
Text body
-
htmlstring Optional -
HTML body
Behaviour in the code
What the implementation does with these keys beyond what the schema says.
-
connection_id - Use a
basic-authcredential withhost,port,secureandfromin its config. Aconnection-stringsecret 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 ansmtp://user:pass@host:portURI) for local tests. -
html - Sent together with
textwhen 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.
{
"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.
{
"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.
| Expression | Editor | Worker |
|---|---|---|
$("Send Email (SMTP)").item.json.resultSend info | ||
$("Send Email (SMTP)").item.json.result.accepted | — | |
$("Send Email (SMTP)").item.json.result.rejected | — | |
$("Send Email (SMTP)").item.json.result.envelope | — | |
$("Send Email (SMTP)").item.json.result.messageId | — | |
$("Send Email (SMTP)").item.json.result.response | — |
— 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_idstring Required -
tostring Required -
subjectstring Required -
textstring Optional -
htmlstring Optional
Output contract
-
resultobject 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
}
}
}{
"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"
]
}{
"type": "object",
"properties": {
"connection_id": {
"type": "string"
},
"to": {
"type": "string"
},
"subject": {
"type": "string"
},
"text": {
"type": "string"
},
"html": {
"type": "string"
}
},
"required": [
"connection_id",
"to",
"subject"
]
}{
"type": "object",
"properties": {
"result": {
"type": "object",
"description": "Send info"
}
}
}[
{
"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
- 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,bccandreplyToare not supported by this node. outmeans 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