Skip to main content

Send Email

Sends an email through an SMTP connection: your company mail server, Microsoft 365, Gmail, or a transactional provider such as Postmark, SendGrid or Amazon SES. The From address and the login come from the connection.

You'll find the step in the toolbox under Built-in steps → Core, or search for it.

Settings​

NameRequiredDescription
SMTP connectionYesThe connection to send with. The picker only lists SMTP connections, with a shortcut to create one
ToYes*Recipients
CcNoCopy recipients
BccNoBlind copy recipients
Reply-ToNoWhere replies should go
From name (overrides the connection's)NoThe sender's display name. The address always comes from the connection
SubjectYesThe subject line
Text bodyNoThe plain-text body
HTML bodyNoThe HTML body
Attachments (file or list of files)NoFiles to attach, see Attachments

* At least one recipient in To, Cc or Bcc is required.

In the workflow JSON the connection is stored as connectionId (steps saved with the older connection key still work). Selecting a connection that isn't an SMTP connection is reported as an error when you publish.

Every field supports expressions:

Subject: Your order {{ $trigger.id }} has shipped
HTML body: <p>Hi {{ $trigger.name }},</p><p>Your order is on its way.</p>

Recipients​

Each recipient field takes one or more addresses separated by commas or semicolons, with or without a name:

ana@example.com, "Doe, John" <john@example.com>; Ops <ops@example.com>

An expression that returns a list of addresses works too, for example {{ $nodes['Database Query'].rows.map(r => r.email) }}. An invalid address fails the step and names the field.

Body​

Set Text body, HTML body or both. With both, the email is sent as multipart/alternative and mail clients show the HTML version, falling back to the text. With neither, the email has an empty text body.

Attachments​

Attachments takes a file, or a list of files, produced by an earlier step, for example Convert to File, File, an HTTP Request download or the attachments of an Email Trigger:

{{ $nodes['Convert to File'].file }}
{{ $trigger.attachments.map(a => a.file) }}

Each attachment keeps its file name and content type. All attachments together may be at most 25 MB. Text that isn't a file fails the step.

Output​

FieldTypeDescription
messageIdStringThe Message-ID of the sent email
acceptedArrayThe addresses the email was sent to (To, Cc and Bcc)
{
"messageId": "LKJ2H3K4J5.6789@example.com",
"accepted": ["ana@example.com", "john@example.com"]
}

Store messageId if you want to match replies later, for example with the Email Trigger's headers.

How it sends​

  • The connection's Security decides the encryption: ssl (TLS from the start, port 465 by default), starttls (port 587 by default) or none. The server's certificate is verified against the host name.
  • If the connection has a username, Blokkio logs in with it. Without one, the email is sent without authentication.
  • The connection needs a From address. Its From name is used unless the step sets one.
  • The SMTP host must be reachable from the internet. Hosts that resolve to private or internal addresses are refused.
  • Each SMTP operation (connect, log in, send) times out after 30 seconds.

Errors​

The step fails with the server's message when the login is refused, a recipient is rejected, TLS fails or the server can't be reached, for example "Send Email: 535: 5.7.8 Authentication credentials invalid". Use the step's error port or retries to handle them.

:::warning Retries can send twice If the server accepted the email but the connection dropped before it confirmed, a retry sends the email again. :::

Self-hosted workers​

Send Email always runs on hosted workers, even when your project is assigned to a self-hosted worker pool. Self-hosted workers never receive connection sign-in details, so Blokkio keeps Send Email steps on hosted workers automatically. The other steps of the workflow still run on your pool.