Skip to content
Skip to main content

SMTP vs REST email API

Last updated:

SMTP is how mail servers have exchanged messages since 1982. It’s everywhere, and it’s a blunt tool for an app that sends on behalf of real users: you manage credentials per mailbox, open a socket per send, and handle deliverability yourself.

A REST email API sends over HTTP instead. You make a request, the message goes out through the user’s own mailbox, and one integration covers every provider. Here’s how the two compare for sending, and when each one fits.

SMTP, standardized in 1982, is a transport protocol: your code opens a socket to a mail server on port 587 or 465, authenticates, and streams the message. A REST email API wraps sending behind an HTTPS request that returns JSON. SMTP needs a username and password per mailbox; a REST API uses OAuth that the provider already authorized, so there are no SMTP credentials to store.

The table below maps the practical differences for sending mail from an app.

DimensionSMTPREST email API
TransportSocket on port 587 or 465HTTPS request and response
AuthUsername and password per mailboxOAuth handled by the API
ProvidersOne server config per accountOne endpoint across Gmail, Outlook, Yahoo, iCloud, IMAP
ResultA delivery attempt, no message objectA message object with an ID
ThreadingYou set headers by handReply keeps the conversation intact
TrackingNot built inOpens, link clicks, and replies

Both put a message in the recipient’s inbox. The REST path returns a structured result you can store and track, where SMTP gives you a transport-level acknowledgment.

SMTP makes sense when you send from a single mailbox you control, already run mail infrastructure, or integrate a legacy system that speaks nothing but SMTP. For a scheduled job that sends to one internal address, an SMTP relay on port 587 is the shortest path and adds no dependency.

The cost shows up at scale. You store credentials for every mailbox, manage a connection per send, and configure SPF and DKIM on each sending domain yourself. Across 200 users, that becomes a credential vault and a deliverability project you own end to end.

A REST email API fits when you send as many different users, want a message ID back, or would rather not store SMTP passwords. One endpoint sends through 5 provider families, so a message from a Gmail user and a message from an Outlook user use the same request. The API refreshes the OAuth token, and the sent message lands in the user’s own Sent folder.

This is the common choice for apps that send on a user’s behalf: support replies, scheduling confirmations, and AI agents. To send through a connected mailbox step by step, read send email without SMTP. For bulk one-off mail from your own domain instead of a user’s mailbox, see transactional send.

Sending over REST is a single POST request. The /v3/grants/{grant_id}/messages/send endpoint sends through the user’s mailbox and returns a message object with an ID, no SMTP handshake involved. The call below sends a message with open, link, and reply tracking enabled in 1 request.

For Node.js and Python versions, see send email without SMTP. The same endpoint handles attachments and reply-to addresses through extra request fields.

Deliverability depends on the sending domain’s reputation and its SPF, DKIM, and DMARC records. With raw SMTP you configure those records for every domain you send from and warm up the sending reputation yourself. Sending through a user’s connected mailbox over REST inherits that mailbox’s existing reputation and authentication across all 5 providers, since the message goes out as the user.

That difference matters most for mail that should look like it came from a person. A reply sent through a customer’s Gmail account passes the same SPF and DKIM checks as any other message they send, with 0 DNS changes on your side. For high-volume mail from your own domain, you still own domain authentication, which is where a dedicated sending service or transactional send fits.

A REST send behaves like a real message in the user’s mailbox, which has a few consequences worth planning for. The sent message appears in the provider’s Sent folder and returns a thread_id, so replies stay grouped in the conversation. To send into an existing thread, include the original message reference rather than relying on subject matching.

Rate limits apply per mailbox, the same as reading mail, and the API retries automatically on 429 responses. Attachments up to 3 MB send as JSON in the request body, and files up to 25 MB use multipart form data, as the send attachments guide explains. For the full sending workflow, see send email without SMTP.

How do I send a reply that stays in the thread?

Section titled “How do I send a reply that stays in the thread?”

Set reply_to_message_id in the send request to the ID of the message you’re replying to. The API adds the In-Reply-To and References headers, so the reply lands in the same conversation across all 5 provider families instead of starting a new thread. Raw SMTP makes you build those headers by hand.

The request below sends a reply that threads correctly by referencing the original message ID.

Because the reply keeps the conversation intact, the recipient sees it grouped under the original message. For reading those grouped conversations back, see email threading in Gmail vs Outlook.

How do I track opens, clicks, and replies?

Section titled “How do I track opens, clicks, and replies?”

Add a tracking_options object to the send request to measure engagement. Set opens, links, and thread_replies to true to track 3 events: message opens, link clicks, and replies. Attach a label to group related sends. The API adds open tracking, rewrites links for click tracking, and reports those events through webhooks. SMTP has none of this built in.

The send request earlier in this guide already enables all three options. For the full setup, including the webhook side, see track email opens.

No. Sending through a connected mailbox over REST uses the OAuth grant the user already authorized. There are no SMTP usernames, passwords, or server hostnames to store, and the token refreshes automatically before it expires.

Can I send from the user’s own email address?

Section titled “Can I send from the user’s own email address?”

Yes. The message goes out through the user’s mailbox, so it comes from their address and lands in their Sent folder. That’s the main reason to send over REST instead of an SMTP relay: the mail looks like the user sent it, with their reputation behind it.

Yes. A REST send writes the message to the provider’s Sent folder, the same as a message the user sends from Gmail or Outlook. The response includes a thread_id, so replies stay grouped in the conversation.