Skip to content

SMTP Destination

The SMTP destination sends outbound email through any standard SMTP server, making it a natural fit for critical alerts, lab result notifications, scheduled reports, and other clinical communication that needs to reach a human inbox.

The subject line supports variable interpolation, so each email can include dynamic context from the message being processed.

destination:
type: smtp
smtp:
host: smtp.hospital.org
port: 587
from: alerts@hospital.org
to:
- oncall-lab@hospital.org
- pathology-team@hospital.org
subject: "CRITICAL: Lab result for ${PATIENT_ID}"
cc:
- lab-archive@hospital.org
content_type: text/html
auth:
username: ${SMTP_USER}
password: ${SMTP_PASSWORD}
tls:
enabled: true
PropertyTypeRequiredDefaultDescription
hoststringYesSMTP server hostname or IP address.
portintNo587SMTP port. Common values: 25 (relay), 465 (implicit TLS), 587 (STARTTLS).
fromstringYesSender email address.
tostring[]YesOne or more recipient email addresses.
subjectstringYesEmail subject line. Supports ${VAR} interpolation from message metadata.
ccstring[]NoCarbon-copy recipients.
bccstring[]NoBlind carbon-copy recipients.
content_typestringNotext/plainBody MIME type: text/plain or text/html.
authobjectNoSMTP authentication credentials.
tlsobjectNoTLS configuration for the SMTP connection.
auth:
username: ${SMTP_USER}
password: ${SMTP_PASSWORD}
PropertyTypeRequiredDefaultDescription
enabledboolNotrueEnable STARTTLS or implicit TLS depending on the port.
insecure_skip_verifyboolNofalseSkip server certificate validation. Not recommended for production.

Send an HTML email whenever a critical lab result is detected:

channels/critical-lab-alerts/channel.yaml
id: critical-lab-alerts
enabled: true
group: laboratory
source:
type: tcp
port: 6661
content_type: hl7v2
mllp: true
transformer: critical-lab-filter.ts
destinations:
- type: smtp
smtp:
host: smtp.hospital.org
port: 587
from: lab-alerts@hospital.org
to:
- oncall-lab@hospital.org
- attending-physician@hospital.org
subject: "CRITICAL: Abnormal ${TEST_NAME} for MRN ${MRN}"
cc:
- lab-archive@hospital.org
bcc:
- compliance@hospital.org
content_type: text/html
auth:
username: ${SMTP_USER}
password: ${SMTP_PASSWORD}
tls:
enabled: true