SMTP
Send email through exx.sh from any framework, CMS or tool that speaks SMTP. Host, ports, login, limits, idempotency and every SMTP reply code.
The SMTP relay at smtp.exx.sh accepts mail from anything that can send through an SMTP
server: web frameworks, CMSs, monitoring tools and mail libraries. A message sent over SMTP
is the same as one sent with the API.
| Setting | Value |
|---|---|
| Host | smtp.exx.sh |
| Port | 587 (STARTTLS) or 465 (TLS) |
| Username | exx (resend works too, so a copied config keeps working) |
| Password | an API key |
Port 465 starts TLS at once; port 587 starts in plain text and switches with
STARTTLS. Pick whichever your software calls "SSL/TLS" (465) or "STARTTLS" (587); there is
no plain-text option. TLS is required on both ports, and lines end in CRLF: a bare LF in the message is refused (500 5.5.2), as RFC 5321 asks. A message sent over SMTP is the same as one sent with the
API: it gets an id, attempts, transcripts and webhook events. Scheduling is not available
over SMTP.
Every message sent over SMTP starts with one trace header, Received: by smtp.exx.sh with ESMTPSA id <message id>; <date>. It names only exx.sh: your server's address and HELO name
are never passed on to recipients.
exx.sh sets the Message-ID of every email, as it does for the API: <email id>@<your domain>, the id 250 2.0.0 queued as <id> returns. Bounces, complaints and webhook events
are matched to the email by it. A Message-ID your software set is not lost: it travels
as X-Original-Message-ID. To thread replies, set In-Reply-To and References; they pass
through unchanged.
# Any SMTP client works: host smtp.exx.sh, port 587 (STARTTLS) or 465 (TLS),
# user "exx", password your API key.
cat > message.eml <<'MAIL'
From: Acme <hello@acme.com>
To: delivered@example.com
Subject: Your sign-in link
Click the link to sign in.
MAIL
# --crlf: SMTP lines end in CRLF; a bare LF in DATA is refused (500 5.5.2).
curl --url smtp://smtp.exx.sh:587 --ssl-reqd --crlf \
--user "exx:$EXX_API_KEY" \
--mail-from hello@acme.com \
--mail-rcpt delivered@example.com \
--upload-file message.emlWith an SDK
Every SDK sends the API's email shape over SMTP and returns the email's id from the
server's 250 2.0.0 queued as <id> reply: ExxSmtp in
TypeScript (@exx.sh/sdk/smtp, with nodemailer) and
Python, exx.NewSMTPClient in Go, and
exx_sh::smtp::ExxSmtp in Rust (the smtp feature). They refuse
tags, scheduling and attachment paths before connecting, since SMTP cannot carry them,
and a refusal keeps its SMTP code (smtp_error).
To make SMTP retries safe, add the header Exx-Idempotency-Key (or Resend's
Resend-Idempotency-Key) with the same rules as the API's Idempotency-Key.
Send newsletters over SMTP
Mail is transactional by default. To send on the distributional stream (newsletters and
other bulk mail), log in as exx+distributional instead of exx. The same rules as the API
apply: bulk mail needs a one-click unsubscribe header (streams).
Limits
A message may be 40 MiB and have 50 recipients, as over the API. Each message counts against your organization's rate limit and quotas, shared with the API.
SMTP replies
| Reply | Meaning |
|---|---|
250 2.0.0 queued as <id> | Accepted; <id> is the email's id |
530 5.7.0 | Log in first, over TLS |
535 5.7.8 | Wrong username or API key |
550 5.7.1 | The From domain is not a verified domain of the key's project, or the project is paused |
552 5.3.4 | The message is too large |
554 5.6.0 | The message cannot be sent as written; the reply text names the problem |
451 4.7.0 | Over the rate limit; the reply says how many seconds to wait |
451 4.7.1 | Over the daily or monthly quota |
A 4xx reply means "try again later": send the message again after the wait, with the same
Exx-Idempotency-Key. A 5xx reply is final for that message.
Common questions
Can I schedule an email over SMTP?
No. Scheduling needs the API's scheduled_at field.
Does exx.sh accept mail on port 25?
No. Port 25 is for servers delivering to exx.sh, such as bounce reports. Submit mail on
465 or 587.
Import from Resend
Copy domains, contacts, lists, topics, templates and webhooks into one project without storing your Resend API key.
Deliverability
What exx.sh does so your mail is accepted, how to read the result of every delivery, the bounce and complaint limits, and how to keep a good sending reputation.