Skip to main content

Free · Open source · Self-hosted

Your own email platform, in one container.

sendthen is an open-source alternative to email services like Resend — except it runs on your server. Send email from your app with one API call, write newsletters, receive replies, and watch every delivery. All from a single Docker container.

  • 100% free & open source
  • One Docker container
  • Your server, your data
import { SendThen } from 'sendthen';

const st = new SendThen('st_xxxxxxxx');

await st.emails.send({
  from: 'you <hello@yourdomain.com>',
  to: 'user@example.com',
  subject: 'Welcome aboard',
  html: '<strong>It just sends.</strong>',
});

This is the whole integration — one request. Copy it, change the domain, and you’re sending.

How it works

Three steps. That’s the whole setup.

No accounts to create with anyone, no sales calls, no plans to pick. You run it, you connect a domain, you send.

  1. Run one container

    Start sendthen on any server with Docker. The app, the database, and the sending queue all live inside one container — there is nothing else to set up.

    docker compose up -d
  2. Connect your domain

    Add your domain in the dashboard and copy the DNS records it gives you. Once they verify, you can send as anything@yourdomain.com.

    TXT stmail._domainkey → verified
  3. Send with one request

    Call the API from any language — or write newsletters and design templates right in the dashboard. Every email shows up with its full delivery story.

    POST /api/v1/emails → 200

Under the hood

Follow one email out the door.

Every email takes the same five steps, and you can watch each one happen in the dashboard or from the CLI.

  1. Your app calls the APIone POST request — that’s the whole integration
  2. sendthen queues itsaved to your database, retried automatically if sending fails
  3. It gets signeda DKIM signature proves the mail really comes from your domain
  4. It goes out — your waythrough Amazon SES, any SMTP relay, or straight to the recipient’s mail server
  5. You see what happeneddelivered, opened, clicked — in the dashboard and pushed to your webhooks
delivery trace — live
$ sendthen trace em_4kq0w2xr
09:31:04.012queuedaccepted via POST /api/v1/emails
09:31:04.019signingDKIM-Signature: v=1; a=rsa-sha256
09:31:04.031handshakeMX gmail-smtp-in.l.google.com → 220
09:31:04.214sent250 2.0.0 OK · accepted
09:31:04.220delivereddelivery event recorded
09:31:04.226webhookPOST /hooks/email → 200

What you get

Everything email, in one place.

Four jobs most products end up paying four different tools for. sendthen does all of them from the same dashboard and API.

Send from your app

The emails your product needs to send — welcomes, receipts, password resets.

  • One POST request sends an email; batches and scheduling included
  • Attachments, tags, idempotency keys, and saved templates
  • Automatic retries, delivery events, and signed webhooks

Send newsletters

Write once and send a personal copy to everyone on a list.

  • Contact lists with per-contact {{variables}}
  • Every subscriber gets their own personalized email
  • One-click unsubscribe and bounce handling built in

Receive email too

Replies and inbound mail land in the same dashboard you send from.

  • Point your domain’s MX record at your instance — that’s it
  • Or receive through Amazon SES or a plain HTTP endpoint
  • Read, search, and forward incoming mail from the built-in inbox

Design emails without code

A visual builder for emails that look right in every mail client.

  • Drag in blocks: logo, buttons, columns, OTP codes, social links
  • Compiles to table-based HTML that email clients render correctly
  • Templates stay editable and reusable with {{variables}}

Why self-host

Why run it yourself?

Your data stays with you

Every email, contact, and template lives in one SQLite file on your server. Back it up, move it, open it — no vendor holds it for you.

Deliver however you want

Send through Amazon SES, any SMTP relay, or directly to the recipient’s mail server. Switch later without changing a line of your code.

One tool for all your email

App emails, newsletters, incoming mail, templates, and analytics share one dashboard — no second service to sign up for.

Compare · checked

How it compares.

This compares how each product is run and operated — not features or deliverability. The managed services are excellent at what they do; they just work differently.

Architecture comparison of Sendthen, Resend, Postmark, SendGrid, and Mailgun, checked 2026-07-13
What we comparedSendthenthis projectResendPostmarkSendGridMailgun
Runs on your own serverYes — you host itManaged serviceManaged serviceManaged serviceManaged service
Source codeOpen (MIT license)Managed serviceManaged serviceManaged serviceManaged service
How your mail is deliveredYou choose: SES, SMTP, or directProvider-managed deliveryProvider-managed deliveryProvider-managed deliveryProvider-managed delivery
Testing without sending real mailBuilt-in sandbox saves emails to diskManaged test addressesManaged sandbox serverManaged request validationManaged test mode
Where your data livesPortable /data volumeProvider-managed stateProvider-managed stateProvider-managed stateProvider-managed state
Software costNone when self-hostedManaged service planManaged service planManaged service planManaged service plan

Self-hosting removes Sendthen software usage fees. Infrastructure and delivery-provider charges still apply.

Managed-service cells describe publicly documented offerings checked 2026-07-13; they do not claim that undocumented or private options cannot exist.

Every claim above, with its official source

Get started

Up and running in three lines.

Clone it, start it, open it. It boots in sandbox mode, so you can try the whole thing — sending, tracking, webhooks — before a single real email leaves your machine.

terminal
git clone https://github.com/emreisik95/sendthen && cd sendthen
docker compose up -d
# open http://localhost:3000

No server handy?

Use the hosted version

The same product, running on our servers instead of yours. Handy for trying sendthen before you deploy it.

Try it hosted

Ready to own your email?

One container, three lines in a terminal, and your email stack runs on your terms.