The SMTP connector sends form submissions as plain-text emails using the platform SMTP relay over raw TCP sockets via cloudflare:sockets. Tenants configure recipient addresses and subject templates; the worker uses platform-managed SMTP credentials and sender identity.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
to |
string[] |
Yes | — | One or more recipient email addresses |
subjectTemplate |
string |
No | "Form submission: {{formName}}" |
Subject line template |
The worker must be configured with these environment variables:
| Variable | Description |
|---|---|
PLATFORM_SMTP_HOST |
SMTP server hostname |
PLATFORM_SMTP_PORT |
SMTP server port |
PLATFORM_SMTP_SECURE_TRANSPORT |
TLS mode: off, starttls, or on |
PLATFORM_SMTP_USERNAME |
SMTP auth username |
PLATFORM_SMTP_PASSWORD |
SMTP auth password |
PLATFORM_SMTP_FROM_EMAIL |
Sender email address used for MAIL FROM; the visible From: header uses this address with a form-specific display name |
| Mode | Behavior |
|---|---|
starttls |
Connect in plaintext, upgrade to TLS after STARTTLS command (port 587) |
on |
Connect with TLS immediately (port 465) |
off |
No TLS — plaintext only (not recommended) |
The connector uses AUTH LOGIN (Base64-encoded username and password). The SMTP conversation follows this sequence:
EHLO formdata.devSTARTTLS (if secureTransport is starttls)EHLO formdata.dev againAUTH LOGIN with Base64 credentialsMAIL FROM / RCPT TO / DATAQUITThe subjectTemplate field supports two variables:
| Variable | Replaced With | Example Output |
|---|---|---|
{{formName}} |
The form's display name | New submission: Contact Form |
{{submissionId}} |
The submission UUID | Submission a1b2c3d4-... |
Default template: Form submission: {{formName}}
Custom example: [{{formName}}] Submission {{submissionId}}
The email is sent as a multipart/alternative message with both plain-text and HTML parts. It includes:
Message-IDFrom: display nameReply-To when the submission payload includes a valid top-level emailThe plain-text part looks like this:
With platform SMTP already configured for the worker, add an email destination like this:
Then test by submitting to your form's ingestion endpoint.
| Port | TLS Mode | Typical Use |
|---|---|---|
| 587 | starttls |
Submission (recommended) |
| 465 | on |
Implicit TLS |
| 25 | off |
Relay (usually blocked by providers) |