SMTP vs Email API: reliable delivery of transactional emails
Published on 2026-11-14 by frfrand
Differences between SMTP and API for application emails, bounces, retries, queues, SPF, DKIM and DMARC.
# SMTP vs Email API: reliable delivery of transactional emails
When an app sends access codes, confirmations, or password resets, “the server accepted the email” does not mean “the recipient received it”. Choosing between SMTP and Email API requires evaluating observability, queuing, security, and retry policy.
1. How they work
SMTP is a standard protocol for transferring mail via a sending server. A provider API usually offers an HTTPS interface to create sends, check statuses, or configure webhooks. No technology alone guarantees deliverability: domain reputation, authentication, and recipient quality matter more than the transport.
| Criterion | SMTP | HTTPS API |
|---|---|---|
| Integration | Standard libraries in many languages | SDK or HTTP calls |
| Detailed statuses | Depends on provider and DSN | Often events/webhooks |
| Key management | SMTP credentials | Scoped API tokens |
| Retries | Decided by client and server according to stage | According to response and provider policy |
| Portability | High between SMTP providers | May require adapting the integration |
2. Distinguish accepting, sending, and delivering
The app places the message in a queue; a worker contacts the provider; the provider accepts or rejects it; finally, delivery, bounce, or complaint events may arrive. Design a state model without presenting "sent" as "delivered". Do not log recovery tokens or sensitive bodies.
3. Recommended architecture
Acción del usuario
-> evento de negocio persistido
-> cola de envío
-> worker con idempotencia
-> SMTP o API del proveedor
-> evento webhook de estado
-> actualización del registro Use a unique identifier per business event to prevent duplicate emails on retries. Distinguish temporary failures (retry with backoff and limit) from permanent failures (do not resend indefinitely). On webhooks, verify the signature and avoid processing the same event twice.
4. Authentication and DNS
Configure SPF, DKIM, and DMARC for the involved domains and validate sender alignment according to your policy. Separate transactional email and bulk campaigns when volume justifies it. Ensure that user replies, such as support or confirmations, reach an attended mailbox.
5. Concrete cases
For a small project that already has reliable SMTP, a robust library with queue and monitoring may suffice. For operations with many events, bounces, and delivery analysis, an API with webhooks can simplify observability. Decide based on SLA, data residency, price, limits, latency, and dependency costs.
6. Testing before production
Force timeout, expired token, 429 response, permanent bounce, and duplicate webhook. Verify that old temporary passwords or already notified purchase emails are not resent. Document a secure way to disable sends during incidents.
Complement with SPF, DKIM, DMARC and mailboxes and workers and background tasks.
Frequently asked questions
Does API guarantee inbox? No. Is SMTP obsolete? No. How do I avoid duplicates? Idempotency per event, queue, and retry control.