Skip to content
Reference

Adapter: SMTP Sender

Send an email per message over SMTP (STARTTLS, SSL or plain): recipients, subject, body, headers and attachments from templates.

On this page

Purpose

Send one email per message over SMTP: alerts, result notifications, or a rendered document to a mailbox. It is the counterpart of the Mirth SMTP Sender, and the Mirth importer maps that connector to it. The profile holds the connection (host, port, encryption, login, a default From); the step holds the email: to, cc, bcc, from, replyTo, subject, body (html for an HTML body), headers and attachments.

Auth

  • encryption: starttls (default, port 587; the upgrade is required, not opportunistic), ssl (implicit TLS, port 465) or none (plain SMTP). Plain SMTP is accepted with a warning on the profile: recipients, content and the login travel in clear text.
  • A login with username and password, or none for a relay that does not ask.
  • The server certificate is always verified, against the system store or the CA in tlsCaPem, with tlsMinVersion (TLS 1.2 by default). A client certificate (tlsClientCertPem and tlsClientKeyPem, or tlsClientPfx) is sent when set.

How a send works

  1. Each field is a template. ${message} (or ${message.encodedData}, ${message.rawData}, ${message.transformedData}) is the message: a text step input as it is, a trigger record's rawMessage, the content of a file/SFTP pickup or a GCS get (not a binary, base64 one), else the input as JSON. Another record's content, such as a REST response's, is not the message: that record renders as JSON. ${name} or ${a.b} is a field of a record input. An unknown reference stays as written. Nothing in a template runs.
  2. The rendered email is checked before anything is sent. A line break or NUL in the subject, an address, a header or an attachment name fails the step (header injection). Addresses are local@domain or Name <local@domain>; a list is split on , and ;. Custom headers cannot replace the address, subject or MIME headers.
  3. attachments lists attachments built from the message (name, content, contentType, encoding text or base64). attachInputDocument attaches the document a Document Writer step returned.
  4. The host must pass the engine's SSRF rules: a private or loopback relay needs an SSRF_ALLOWLIST entry. The engine connects to the address it checked and verifies the certificate against the host name.
  5. The step returns { sent, messageId, accepted, rejected }, with counts, never addresses. A failure names the SMTP phase and reply code only. A refused recipient or login (5xx) is not retried; a failure before the message data was sent is retried; one during the data is reported as uncertain and not resent automatically.

Settings

Auth is no selector; the secret settings below are the credentials. Dotted names are fields inside an object setting. Secret settings are encrypted at rest, never returned by a read, and shown masked in the console and in exports; their defaults are not shown.

SettingTypeRequiredDefaultSecretDescription
hoststringYesNoSMTP server host name or address.
portnumberNo587NoSMTP port: 587 for STARTTLS, 465 for SSL, 25 for plain.
encryptionenum: starttls, ssl, noneNostarttlsNostarttls (required upgrade), ssl (implicit TLS) or none (plain SMTP: content and login in clear text).
usernamestringNoNoLogin user; leave empty for a relay without authentication.
passwordstringNoYesLogin password (encrypted at rest).
fromstringNoNoDefault From address, e.g. MedHook <alerts@example.org>.
timeoutMsnumberNo30000NoConnect, greeting and socket timeout in milliseconds.
tlsCaPemstringNoYesPEM CA certificate(s) to verify the server against. See tlsCaMode.
tlsCaModeenum: replace, addNoNoTrust: replace = only this CA (default), add = the system CAs plus this CA. Needs tlsCaPem.
tlsClientCertPemstringNoYesPEM client certificate, for servers that require mutual TLS. Set with tlsClientKeyPem.
tlsClientKeyPemstringNoYesPEM private key for the client certificate (encrypted at rest).
tlsClientPfxstringNoYesClient certificate and key as a base64 PKCS#12 (.p12 / .pfx) bundle, instead of the PEM pair.
tlsClientPassphrasestringNoYesPassphrase of the PKCS#12 bundle.
tlsMinVersionenum: TLSv1.2, TLSv1.3NoNoLowest TLS version to accept (default TLSv1.2).

Actions

A trailing ? marks an optional step parameter. A message can supply only the keys in the last column; everything else comes from the step.

ActionWhat it doesStep parametersKeys a message may supply
sendSend one email built from the step settings and the message.to?, cc?, bcc?, from?, replyTo?, subject?, body?, html?, headers?, attachments?, attachInputDocument?None

Minimal example

The smallest profile the engine accepts: the required settings only, with synthetic values. Create it with POST /api/adapter-profiles, then test it with POST /api/adapter-profiles/{id}/test.

json
{
  "name": "SMTP Sender (example)",
  "adapterType": "smtp",
  "config": {
    "host": "example-host"
  }
}

Limits

  • At most 100 recipients, 32 custom headers and 10 attachments per email; an attachment up to 10 MB and 20 MB together; a subject up to 998 characters.
  • The email is sent as UTF-8. A Mirth charset other than UTF-8 is reported on import.
  • Attachments are bytes built from the message. A file path or URL attachment is not possible.
  • Bodies, recipients and subjects are never logged.

Reference