Every sending platform offers SMTP relay and an HTTP API. The differences in latency, error handling, portability, and observability, and how to choose per workload.
Point your application at smtp.provider.com:587, or POST JSON to /v3/mail/send: every transactional provider offers both doors into the same delivery infrastructure. Teams usually pick whichever the first tutorial showed them and never revisit the decision. The two paths differ in ways that surface later, in error handling, in migration cost, and in what your observability can see, so the choice deserves ten deliberate minutes.
What actually differs
Protocol shape and errors
SMTP is a stateful conversation: connect, authenticate, envelope, data, response. Its errors arrive as the reply codes our bounce classification article dissected, and a submission failure means parsing 4xx/5xx semantics from a text stream. The API path is a stateless HTTP request with structured JSON errors: a 400 tells you which field is malformed, a 429 tells you that you hit your rate limit, and your existing HTTP client, retry middleware, and tracing already understand all of it.
That difference sounds cosmetic and is not. Application code that submits over SMTP tends to treat submission as fire-and-forget because handling SMTP conversation failures well is genuinely awkward in most web stacks. The same team integrating an API tends to handle the 429 properly because it looks like every other dependency. The protocol nudges the error-handling quality.
Performance under volume
For single messages the latency difference is noise. At batch scale the architectures diverge: SMTP requires connection management, pipelining, and one DATA transaction per message, while APIs accept a thousand personalized recipients in one HTTP request with template substitutions server-side. If you send bursts, the API's batch endpoints move the fan-out problem to the provider, which is usually where it belongs. Conversely, a well-tuned MTA speaking SMTP to the relay can saturate throughput just fine; postal-grade senders have done it for decades. The question is who you want operating that tuning.
Portability and lock-in
SMTP is the universal interface. An application that emits RFC 5322 messages over SMTP can switch providers by changing a hostname and credentials, which makes it the natural choice for the parallel-running phase of an ESP migration. API integrations couple you to one vendor's request shapes, template language, and feature set; the switching cost is a code migration, not a config change. Abstraction libraries soften this, but every provider-specific feature you adopt, dynamic templates, scheduled sends, subuser management, is a strand of lock-in you chose.
Observability
Both paths end in the same place: provider webhooks for delivered, bounced, complained, and clicked events. The difference is submission-side. API requests carry your correlation IDs naturally in custom arguments and return message IDs synchronously, which makes end-to-end tracing (request to webhook) straightforward. Over SMTP, correlating submissions to webhook events means embedding identifiers in headers and trusting them to round-trip. Solvable, and routinely left unsolved.
Deliverability is mostly indifferent
Worth stating plainly: mailbox providers cannot see which door you used. Once the message leaves the provider's MTAs, authentication, reputation, and content decide everything, exactly as always. The deliverability-relevant differences are indirect: the API path's better error discipline prevents retry storms during incidents, its rate limiting is more legible, and its structured suppression handling makes it slightly harder to accidentally mail your bounce list. These are operational qualities, not filtering inputs.
Choosing per workload
Which door for which mail
| Feature | SMTP relay | HTTP API |
|---|---|---|
| Legacy app, appliance, or CMS that already speaks SMTP | ✓ | ✕ |
| New application code you control | workable | ✓ |
| Large personalized batches | requires MTA tuning | batch endpoints |
| Provider portability | hostname change | code migration |
| Structured errors and tracing | SMTP codes, manual correlation | JSON errors, native IDs |
| On-premises MTA in the path (compliance, queuing control) | ✓ | ✕ |
The hybrid pattern deserves mention because mature setups converge on it: an internal MTA (Postfix or similar) as the local smarthost for everything on the network that speaks SMTP, relaying outbound to the provider, while first-party application code uses the API directly. The MTA gives legacy systems a stable interface and a local queue that survives provider outages; the API gives your product code the ergonomics. Both routes authenticate with the same domain identity, per our subdomain strategy, so the mailbox providers see one coherent sender.
Whichever door you pick, the invariants stay: your DKIM domain on every message, suppression lists enforced before submission, webhook events flowing into the bounce and complaint pipelines this series keeps returning to. The transport is plumbing. The identity and the feedback loops are the parts that decide whether the mail arrives.
Frequently Asked Questions
Is the API faster than SMTP?
Which is more reliable during provider incidents?
Port 25, 465, or 587 for relay submission?
Do webhooks differ between the two paths?
Key Takeaways
- Mailbox providers cannot tell which submission door you used; deliverability rides on identity, reputation, and content either way
- APIs give structured errors, batch endpoints, and native correlation; SMTP gives universality and hostname-swap portability
- Constructing MIME in your own code and using providers as pure transport keeps migrations cheap
- The hybrid pattern, local MTA smarthost for legacy plus API for product code, is where mature stacks land
- A queue you control, MTA or self-built, is what survives provider outages without losing mail
Related articles
Greylisting, Tarpitting, and Other Receiver Defenses Senders Should Understand
Receiving servers defend themselves with deliberate delays, temporary rejections, and traps for impatient senders. How each defense works and how a good MTA passes them.
Building a Deliverability Monitoring Stack
Postmaster Tools, SNDS, FBLs, DMARC reports, TLS-RPT, bounce logs, engagement data: the full observability stack, what each layer catches, and the alerts worth paging on.
Duplicate Sends: Idempotency in Email Pipelines
Everyone has received the same email twice. The retry loops, queue semantics, and race conditions that cause duplicates, and the idempotency patterns that stop them.