Adapter: SMTP Sender
Send an email per message over SMTP (STARTTLS, SSL or plain): recipients, subject, body, headers and attachments from templates.
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) ornone(plain SMTP). Plain SMTP is accepted with a warning on the profile: recipients, content and the login travel in clear text.- A login with
usernameandpassword, or none for a relay that does not ask. - The server certificate is always verified, against the system store or the CA in
tlsCaPem, withtlsMinVersion(TLS 1.2 by default). A client certificate (tlsClientCertPemandtlsClientKeyPem, ortlsClientPfx) is sent when set.
How a send works
- 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'srawMessage, thecontentof a file/SFTP pickup or a GCS get (not a binary, base64 one), else the input as JSON. Another record'scontent, 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. - 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@domainorName <local@domain>; a list is split on,and;. Custom headers cannot replace the address, subject or MIME headers. attachmentslists attachments built from the message (name,content,contentType,encodingtextorbase64).attachInputDocumentattaches the document a Document Writer step returned.- The host must pass the engine's SSRF rules: a private or loopback relay needs an
SSRF_ALLOWLISTentry. The engine connects to the address it checked and verifies the certificate against the host name. - 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.
| Setting | Type | Required | Default | Secret | Description |
|---|---|---|---|---|---|
host | string | Yes | No | SMTP server host name or address. | |
port | number | No | 587 | No | SMTP port: 587 for STARTTLS, 465 for SSL, 25 for plain. |
encryption | enum: starttls, ssl, none | No | starttls | No | starttls (required upgrade), ssl (implicit TLS) or none (plain SMTP: content and login in clear text). |
username | string | No | No | Login user; leave empty for a relay without authentication. | |
password | string | No | Yes | Login password (encrypted at rest). | |
from | string | No | No | Default From address, e.g. MedHook <alerts@example.org>. | |
timeoutMs | number | No | 30000 | No | Connect, greeting and socket timeout in milliseconds. |
tlsCaPem | string | No | Yes | PEM CA certificate(s) to verify the server against. See tlsCaMode. | |
tlsCaMode | enum: replace, add | No | No | Trust: replace = only this CA (default), add = the system CAs plus this CA. Needs tlsCaPem. | |
tlsClientCertPem | string | No | Yes | PEM client certificate, for servers that require mutual TLS. Set with tlsClientKeyPem. | |
tlsClientKeyPem | string | No | Yes | PEM private key for the client certificate (encrypted at rest). | |
tlsClientPfx | string | No | Yes | Client certificate and key as a base64 PKCS#12 (.p12 / .pfx) bundle, instead of the PEM pair. | |
tlsClientPassphrase | string | No | Yes | Passphrase of the PKCS#12 bundle. | |
tlsMinVersion | enum: TLSv1.2, TLSv1.3 | No | No | Lowest 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.
| Action | What it does | Step parameters | Keys a message may supply |
|---|---|---|---|
send | Send 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.
{
"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.