← All posts

SMTP vs REST API for sending email: which should you use?

smtpapi

Most email services offer two ways to send: classic SMTP submission and an HTTP API. Both end in the same place, but they suit different situations.

SMTP submission

SMTP is the original email protocol. Your application, framework or device connects to an SMTP server (usually on port 587 with STARTTLS), authenticates with a username and password, and hands over the message.

Choose SMTP when:

  • The software already speaks SMTP (CMS platforms, printers, legacy systems, many frameworks).
  • You want to switch providers by changing a host name and credentials.

Watch out for:

  • Always use TLS. Never send credentials over an unencrypted connection.
  • SMTP responses are coarse. Distinguishing a temporary failure from a permanent one depends on reading the reply code.
  • It is harder to attach custom metadata or deduplicate retries.

REST API

An HTTP API accepts a JSON request over HTTPS and returns a structured response.

curl -X POST https://your-host/api/v1/emails \
  -H "Authorization: Bearer $API_KEY" \
  -H "Idempotency-Key: order-1042" \
  -H "Content-Type: application/json" \
  -d '{"from":"receipts@example.com","to":["a@example.net"],"subject":"Receipt","text":"Thanks!"}'

Choose the API when:

  • You are writing new code and want clear, machine-readable errors.
  • You need idempotency, so a retry cannot send the same message twice.
  • You want easy access to message identifiers for later status lookups.

Retries and idempotency

Networks fail. If a request times out you do not know whether the message was sent. With an idempotency key, you can safely repeat the request and the service will not create a duplicate. Whichever method you use, decide up front how your application handles timeouts and temporary errors.

Which one with MiniSend?

MiniSend supports both, with the same projects, quotas and delivery tracking behind each. Use the REST API for new applications and SMTP for software that only speaks SMTP.


Want to try MiniSend? Get started or contact us.