On this page
  1. SMTP vs email API at a glance
  2. Which is faster, SMTP or an email API?
  3. Your app's side: handshake overhead per message
  4. Time to inbox: the provider decides, not the method
  5. Throughput: connection reuse and batch endpoints
  6. Which is more secure, SMTP or an email API?
  7. Transport: TLS on both, but SMTP leaves the choice to you
  8. Credentials: API keys, scopes and SMTP logins
  9. Features you only get through an email API
  10. Errors and debugging with SMTP and with an API
  11. Which email services support both SMTP and an API?
  12. Can you use both SMTP and an email API, or switch later?
  13. SMTP relay or email API for a B2B app?
  14. Which should you choose: SMTP or an email API?
  15. FAQ

SMTP vs Email API: Which Should You Use?

Use an email API for new code, because one HTTP call gives you templates, batch sending and a clear response per request; use SMTP when the software you run can only speak SMTP, such as a CMS, a legacy app or a device. Most email services support both, so the choice is not permanent.

Written by Relay, the Email Stack Review teamPublished Updated No ads or affiliate links
Choosing a provider? See the best email APIs.

You are probably looking at a settings screen that wants an SMTP host, or at an API reference that wants a JSON body, and wondering which one to wire up. The short answer is above. The rest of this page is the evidence: what changes per message, what the speed question really comes down to, what you lose on SMTP, and which services let you do both. (If you are still sorting out how an app hands mail to a service at all, start with how transactional emails are sent.)

Key takeaways

  • An email API is the better default for code you write: templates, batches and a response for every request. SMTP is the right choice when software only has an SMTP settings screen.
  • Sending method changes how long your app waits per message, not how fast mail reaches the inbox. No independent comparison of delivery speed by method exists (checked November 11, 2026).
  • Both methods can use TLS. With SMTP the port you pick decides whether it is on; at six of the ten services, the SMTP login is the API credential itself.
  • Templates, scheduling and idempotency keys are API features at most services. What works over SMTP headers differs per service, and we list it.
  • All ten services on our main ranking support both SMTP and an API, so you can start on one and move later.

SMTP vs email API at a glance

SMTP and an email API are two ways to hand the same message to a sending service, and they differ in setup effort, per-message overhead, features, credentials and error feedback. The table gives one line per row. For the definition of an email API, see what an email API is.

SMTP Email API
Setup Host, port, username and password in any mail library or app setting An HTTPS request with a key in a header, usually through an official SDK
Speed of integration Minutes when the software already has an SMTP settings screen More work, because your code builds the request
Per-message overhead A connection, TLS and login, then a command and reply for each step of the message (RFC 5321), unless the connection is reused One HTTPS request and one response per message or batch
Features A standard message plus headers; extras depend on vendor-specific X-headers JSON fields for templates, tags, batches and scheduling, varying by service
Security TLS on the port and mode you pick; the login is an SMTP credential, often the API key itself HTTPS by definition; keys can be scoped at some services
Errors A reply code at hand-off; later failures arrive as bounces or events An HTTP status and a body per request; later events by webhook
Portability Same protocol at every provider; switching is a host and credentials Each vendor's own payload and SDK; switching is a code change
Use it when The software only speaks SMTP You control the code

Here is what the two setups look like at one vendor. Resend lists the SMTP settings below, and its API takes a single request.

Host: smtp.resend.com
Port: 25, 465, 587, 2465, or 2587
Username: resend
Password: YOUR_API_KEY

From Resend's docs (Send emails with SMTP), checked November 11, 2026.

curl -X POST 'https://api.resend.com/emails' \
     -H 'Authorization: Bearer re_xxxxxxxxx' \
     -H 'Content-Type: application/json' \
     -d $'{
  "from": "Acme <onboarding@example.com>",
  "to": ["delivered@example.com"],
  "subject": "hello world",
  "html": "<p>it works!</p>"
}'

From Resend's docs (Send Email API reference), checked November 11, 2026; addresses changed to example.com.

Which is faster, SMTP or an email API?

The sending method changes how long your app waits per message, not how quickly the message reaches the inbox. Those are two separate clocks, and a third one decides how many messages you can push per minute.

Your app's side: handshake overhead per message

SMTP opens a connection, negotiates TLS and logs in before the first message; an email API call is one HTTPS request and one response. SendGrid's own SMTP walkthrough shows what follows the connection: five command-and-reply exchanges for one message (login, MAIL FROM, RCPT TO, DATA and the closing dot), plus one more RCPT TO for each extra recipient (Twilio SendGrid docs, checked November 11, 2026).

The gap is per connection, so it has no fixed size in milliseconds, and we found no published figure for it. A client that reuses an SMTP connection pays the handshake once, because RFC 5321 allows zero or more mail transactions in one session.

An HTTP client that keeps its connection alive does the same on the API side. So the honest comparison is one request against several exchanges per message, not a number.

Time to inbox: the provider decides, not the method

Time to inbox depends on the sending service's queue and the receiving mailbox provider, not on whether the message arrived by SMTP or by API. Resend's SMTP page says SMTP sends show up in the same emails table as API sends and share the API's rate limit (Resend docs, checked November 11, 2026). SendGrid's final SMTP reply only says the message is queued; delivery comes after.

No independent comparison of SMTP and API delivery speed exists, as far as we could find (checked November 11, 2026). The closest result is a May 2026 report from Warmy, which we do not use.

Warmy sells email warm-up software and ran the study on its own sending data. It compares Google's SMTP relay with the Gmail API, not transactional email services, and it does not say how the two groups of senders were matched. For placement data by provider, see the deliverability section of our ranking.

One speed number is published, and it covers the API leg only. Knock's "API response time" (Knock, median, 12 Aug–10 Nov 2026) is the time from Knock's request to the provider's 200 acceptance. Across nine of the ten services in the table below it runs from 14 ms for SendGrid to 405 ms for Mailjet, with no figure for Brevo.

It measures acceptance, not delivery, and it has no SMTP side. Knock is a notification vendor that sells provider routing (Knock's benchmarks).

Throughput: connection reuse and batch endpoints

Throughput on SMTP comes from reusing one connection for many messages; on an API it comes from batch endpoints, and the plan's rate limit caps both. Resend states that its rate limit applies to SMTP the same as to the API.

Batch size per call differs a lot: from 50 per call at Mailjet and Amazon SES to 1,000 at Mailgun, SendGrid and Brevo, counted in different units such as messages, destinations or recipients (table below). Brevo shows the split clearly: its API takes up to 1,000 message versions in one call, while its SMTP relay does not support batch sending.

That's speed. Now the part that is easier to get wrong: who holds the keys.

Which is more secure, SMTP or an email API?

Neither method is inherently safer: both can encrypt traffic with TLS, and the real difference is the credential you hand out. An API key can be scoped at some services, while an SMTP login is often the API key under another name.

Transport: TLS on both, but SMTP leaves the choice to you

An email API call is HTTPS, so TLS is part of the request. SMTP offers two ways to get TLS, and RFC 8314 (January 2018) recommends TLS 1.2 or greater for mail submission and prefers implicit TLS over STARTTLS (RFC 8314).

Services differ on what they offer. Resend, Mailgun, Brevo, Mailjet, SparkPost and Mailtrap list implicit TLS on port 465; Postmark lists STARTTLS only. Both settings cover only the hop from your app to the service; TLS between mail servers on the way to your own inbox is set by the receiving domain, with MTA-STS.

The catch: Brevo's SMTP guide lists ports 587 and 2525 with encryption left empty, and Mailjet marks TLS as optional on ports 25, 80, 587, 588 and 2525. With SMTP, read the port table before you copy a setting. Ports and TLS modes per service are on SMTP ports and TLS compared.

Credentials: API keys, scopes and SMTP logins

At six of the ten services below, the SMTP login is the API credential itself, so a leaked SMTP config is a leaked API key. Brevo and MailerSend issue separate SMTP credentials, Mailgun gives each domain its own (or accepts the API key), and Amazon SES generates them from an IAM user.

The middle column is what each service documents for scoping the API key. Whatever you choose, keep the secret in an environment variable or secrets store, not in code.

Service API key scoping (vendor docs) SMTP login
Resend full_access or sending_access; sending keys can be limited to one domain Username resend, password is the API key
Postmark Server Token per server and Account Token; no finer scopes documented Server API token as username and password
Mailgun Domain Sending Keys (send only, one domain); RBAC roles on some plans The domain's SMTP credentials, or the API key
SendGrid Full, Custom (per endpoint, incl. read-only), Billing; no per-domain scoping documented Username apikey, password is the API key
Amazon SES IAM policies, with condition keys such as From address and recipients Credentials generated from an IAM user
Mailtrap Tokens with per-resource permissions; expiry from 1 day to 365 days or a custom date Username and password (the API token) from the dashboard
MailerSend Sending, Full or Custom access per endpoint; token tied to a domain SMTP username and password
Brevo One all-access key per key, optional IP allowlist; OAuth tokens with scopes An SMTP key, not an API key
Mailjet Public and private key pair; no per-endpoint scopes documented API public key as login, private key as password
SparkPost Named scopes with read and write levels, read-only keys possible, workspace-bound The API key

Sources: each vendor's API key and SMTP documentation, listed in our tool index, checked November 11, 2026 (SMTP logins November 10, 2026; SendGrid's from its SMTP walkthrough).

Features you only get through an email API

Stored templates, batch calls, scheduling, idempotency keys and a structured response are email API features, while SMTP carries a message and its headers. Which headers a service reads is per service, not a rule, so the table lists what each documents.

Templates are not the dividing line at the vendor level: all ten services have a templates API (checked November 11, 2026). The dividing line is the send call.

Sending a stored template by ID with variables is an API call; over SMTP only Mailgun, Mailjet and Brevo document it. MailerSend and SparkPost say templates are API only, and for Resend, Postmark, SendGrid, Amazon SES and Mailtrap it is not documented. Our templates how-to is transactional email templates.

Service What works over SMTP (documented) Scheduling in the API Idempotency key
Resend Custom headers; Resend-Idempotency-Key scheduled_at, up to 30 days Yes (HTTP header; SMTP header)
Postmark X-PM-Tag, X-PM-Metadata-*, X-PM-TrackLinks, X-PM-Message-Stream Not documented Not documented
Mailgun Template name, version and variables; deliver-by and deliver-within; recipient variables o:deliverytime, 3 or 7 days by plan Not documented
SendGrid X-SMTPAPI: send_at, category, unique_args, filters send_at, up to 72 hours Not documented
Amazon SES Configuration set, message tags and tenant headers No send_at parameter Not documented
Mailtrap Custom headers and variables not documented Not documented for transactional Not documented
MailerSend Only X-MailerSend-Tags (5 tags) kept; other custom headers dropped send_at, up to 72 hours Not documented
Brevo Template ID, params, tags and scheduledAt as JSON through the relay; no batch scheduledAt, up to 72 hours Yes, batch sends only (30-minute window)
Mailjet X-MJ-TemplateID, X-MJ-TemplateLanguage, X-MJ-Vars Not documented for transactional Not documented
SparkPost Message content only; scheduling and stored templates not available scheduled_at, 30 seconds to 30 days Yes (header; SMTP header X-Bird-Idempotency-Key)

Mailgun and Brevo document the most over SMTP, and MailerSend and SparkPost the least. "Not documented" means we found nothing in the vendor's docs on November 11, 2026, not that the feature is missing. Batch sending, the other API-only feature, is in the table in the next section.

Errors and debugging with SMTP and with an API

An email API returns a status code and a body for every request, while SMTP returns a reply code at hand-off and reports later failures as bounces or events. Both need webhooks for what happens after the hand-off; see email APIs with webhooks.

On SMTP, the reply you get is about acceptance: SendGrid's walkthrough ends with "250 Ok: queued", which means the message sits in the send queue, not in the inbox. On an API, the body is richer. Postmark returns {ErrorCode, Message} with an integer code, Resend names each failure (validation_error, daily_quota_exceeded) and SparkPost returns a JSON error with a code, name and request ID.

An API 200 is not always a success, though. Mailtrap's batch endpoint returns HTTP 200 even when individual messages fail, so you read the responses array. MailerSend validates bulk requests after accepting them and gives you a bulk ID to poll.

SMTP debugging can be thinner too: Resend says it provides no SMTP server logs for debugging, although SMTP sends appear in its emails table. For retries and failure handling, see reliable sending in our best practices.

Which email services support both SMTP and an API?

All ten services on our main ranking support both SMTP and an API: Resend, Postmark, Mailgun, SendGrid, Amazon SES, Mailtrap, MailerSend, Brevo, Mailjet and SparkPost. That answers the common question about a tool that supports both: any of them does, so pick on the other differences.

"SMTP API" is used for two things: a service that offers both an SMTP endpoint and an HTTP API, as the services in the table below do, and API-style options passed through SMTP headers. SendGrid documents the second kind as Integrating with the SMTP API (an X-SMTPAPI header) and SparkPost as its SMTP API (an X-MSYS-API header), both checked November 28, 2026.

Service API SMTP Batch call (API)
Resend Yes Yes Up to 100 emails; no attachments in batch
Postmark Yes Yes Up to 500 messages
Mailgun Yes Yes Up to 1,000 recipients
SendGrid Yes Yes Up to 1,000 personalizations
Amazon SES Yes Yes Up to 50 destinations (SendBulkEmail)
Mailtrap Yes Yes Up to 500 messages
MailerSend Yes Yes Up to 500 per request, asynchronous; Hobby plan or higher
Brevo Yes Yes Up to 1,000 message versions; not over SMTP
Mailjet Yes Yes Up to 50 messages (Send API v3.1)
SparkPost Yes Yes Up to 100 messages

How we compared: vendor docs, API references and pricing pages; API and SMTP support verified November 6 to 11, 2026, batch limits November 11, 2026; no sending tests; no ads, affiliate links or paid placements. Official SDKs per language are compared in best email APIs by language.

Five more services in our index also offer both:

  • SMTP2GO: a batch endpoint of up to 1,000 emails per call; see the SMTP2GO review.
  • Elastic Email: bulk endpoints, but no stated maximum per call; see the Elastic Email review.
  • ZeptoMail (now sold as Zoho CPaaS): a batch endpoint with no documented maximum; see the ZeptoMail review.
  • SendLayer: no batch endpoint documented, only recipient arrays; see the SendLayer review.
  • SMTP.com: an SMTP relay plus a REST API with a public OpenAPI spec; see the SMTP.com review.

Can you use both SMTP and an email API, or switch later?

Yes: at the services above you can use both methods at once or move from one to the other, and switching is credentials plus a code change, not a new account. Resend, for one, shows SMTP and API sends in the same emails table. A short migration path:

  1. Start on SMTP. Point the software at the host, port and login from free SMTP servers: settings. That is the fastest way to a first delivered message, and setting up sending covers the domain steps.
  2. Move the hot paths to the API. Receipts and password resets benefit first from templates, a response per request and, where offered, idempotency keys.
  3. Leave SMTP-only software on SMTP. A CMS or a printer keeps working on the same account.

One thing does not transfer. SMTP is the same protocol at every provider, but the X-headers are not: Mailgun's template headers mean nothing to Postmark.

If you rely on headers for tags or templates, treat them as part of the vendor integration. Free plans for both routes are on free email APIs and free SMTP servers.

SMTP relay or email API for a B2B app?

For a B2B app, send through the API from code you control and offer SMTP where your customers' software or mail servers need it. An SMTP relay (see what an SMTP relay is) accepts mail from your software over SMTP and delivers it for you; the decision depends on who controls the sending code.

Your situation Use Why
New app, you write the sending code Email API Templates, per-request errors and batch endpoints
Product that exposes an SMTP setting: a CMS, ERP, CRM or printer SMTP relay You cannot change the code, only the host and login
Your customers bring their own mail server Support SMTP in your app Their servers speak SMTP, not your vendor's API
High volume Either Decided by connection reuse and batch limits; see high-volume email APIs

Which should you choose: SMTP or an email API?

Choose the email API when you write the code, and SMTP when you only configure the software. That is the whole decision for most teams.

Scenario Method
You are building a new app or service Email API
The software has an SMTP settings screen and no API option SMTP
You need stored templates, batches or scheduling in the send call Email API
You want the option to change providers with the least work SMTP, keeping vendor headers to a minimum

Once you have chosen, compare providers in our best email APIs ranking, the best SMTP relay services or the broader best transactional email services. Our default: start on the API, keep SMTP for whatever refuses to learn HTTP, and revisit if a vendor's SMTP route lacks something you need.

Ready to pick a service? Compare the best email APIs.

SMTP vs email API: FAQ

Should I use SMTP or API for transactional email?

Use an email API for code you write, because it gives you templates, batch calls and a response for each request. Use SMTP when the software only has an SMTP settings screen, such as a CMS or a legacy app. All ten services on our main ranking support both. See which to choose.

Is an email API faster than SMTP?

For your app's wait per message, usually yes, because SMTP needs several command-and-reply exchanges after connecting and an API call needs one request. For time to inbox, no: the sending service's queue and the receiving mailbox provider decide it. No independent comparison by method exists (checked November 11, 2026). See which is faster.

Is SMTP less secure than an API?

Not by transport: SMTP can use TLS and an API uses HTTPS. The differences are that SMTP leaves the port and TLS mode to you, and that the SMTP login is often the API key itself, which limits scoping. RFC 8314 prefers implicit TLS. See which is more secure.

Which email services support both SMTP and an API?

All ten services on our main ranking do: Resend, Postmark, Mailgun, SendGrid, Amazon SES, Mailtrap, MailerSend, Brevo, Mailjet and SparkPost. SMTP2GO, Elastic Email, ZeptoMail, SendLayer and SMTP.com do too. The comparison table shows batch limits for each.

What is an SMTP API?

"SMTP API" means either a service that offers both an SMTP endpoint and an HTTP API, or API-style options passed in SMTP headers, as in SendGrid's X-SMTPAPI and SparkPost's X-MSYS-API. See which services support both.

Can I switch from SMTP to an API later?

Yes. Switching is credentials plus a code change, on the same account. Start on SMTP, move the receipts and password resets to the API, and leave SMTP-only software as it is. Vendor-specific X-headers do not carry over between services. See switching later.

Do I need an API to send templates or batches?

Mostly yes. All ten services have a templates API, but only Mailgun, Mailjet and Brevo document template sends over SMTP, and Brevo's SMTP relay does not support batch sending. For the other services, templates over SMTP are not documented or are API only. See features you only get through an API.

Is the Gmail API better than Gmail SMTP?

It is a different job. Both send from a Google mailbox rather than from a transactional email service, so the rule is the same as above: use the API from code that can call it, and SMTP for software that only has an SMTP setting. For app mail at volume, compare services in our best transactional email services ranking.

Which free or low-volume service has both SMTP and an API?

The same ten services appear on both our free email API list and our free SMTP list: Resend, Mailtrap, Brevo, Postmark, Mailgun, Mailjet, SMTP2GO, MailerSend, Elastic Email and SparkPost. MailerSend's Free plan asks for a credit card with no charge (pricing page, November 10, 2026). Limits and catches are on free email APIs and free SMTP servers.

What changed

  • Mailtrap now lists port 465 with implicit TLS next to STARTTLS on 587, 25 and 2525.
  • First version.