The basic SMTP conversation
A complete envelope handshake is four commands and one body. Servers respond with three-digit reply codes (2xx success, 4xx temporary failure, 5xx permanent failure).
S: 220 mta.example.com ESMTP
C: HELO sender.example.org
S: 250 Hello sender.example.org
C: MAIL FROM:<alice@example.org>
S: 250 OK
C: RCPT TO:<bob@example.com>
S: 250 OK
C: DATA
S: 354 End data with <CRLF>.<CRLF>
C: From: alice@example.org
C: To: bob@example.com
C: Subject: Hello
C:
C: Body of the message
C: .
S: 250 OK queued as 4f8a3
C: QUIT
S: 221 ByeThe envelope vs the headers
SMTP has two notions of who sent / received a message: the envelope (the MAIL FROM and RCPT TO commands above) and the headers (the From: and To: lines inside the body).
These can differ — and often do, deliberately. A forwarder rewrites the envelope sender to itself but leaves the header From: untouched. An automated send might use a bounce@yourdomain.com envelope sender to route bounces into a process that handles them, while the user sees hello@yourdomain.com in From:. Authentication mechanisms (SPF, DMARC) care about both.
Ports: 25, 465, 587, 2525
25 — Server-to-server delivery. Most ISPs block outbound 25 on residential / cloud-VM networks to suppress spam from compromised hosts. Always cleartext-by-default; STARTTLS upgrade is optional but ubiquitous.
465 — Implicit-TLS submission. Originally non-standard, now formally defined in RFC 8314. Used by mail clients submitting to their provider.
587 — Submission port (RFC 4409). The standard port for authenticated mail clients to submit outbound mail. Cleartext-by-default with mandatory STARTTLS upgrade.
2525 — Unofficial alternative when 25/587 are blocked. Many providers (SNDR included) offer SMTP on 2525 for serverless / cloud users whose providers block the standard ports.
STARTTLS and opportunistic encryption
STARTTLS is the SMTP command that upgrades a cleartext connection to TLS. Most server-to-server SMTP is opportunistic — both sides offer STARTTLS, both sides upgrade if able, but plaintext is still acceptable as a fallback.
MTA-STS (RFC 8461) tightens this by letting domains publish a policy saying "always require TLS when sending mail to me" — a defence against active downgrade attacks. TLS-RPT (RFC 8460) sends reports back when STARTTLS negotiation fails.
When to use SMTP vs an HTTP API
HTTP APIs (POST /v1/send) are easier to integrate, give structured error codes, support idempotency keys, and work on every serverless platform — they are the default.
SMTP is the right choice when you need byte-perfect control over the message body (specific MIME structure, custom headers, exotic encodings), when integrating legacy software that only speaks SMTP, or when a serverless host blocks outbound HTTP to email APIs.
SNDR speaks both. The HTTP API is recommended for greenfield code; the SMTP relay is available for the cases the API does not cover.