Skip to content

Email provider

Your product can’t run without email: people verify their address before they can sign in.

Nothing to set up. Every email the app sends is caught by Mailpit at http://localhost:8025, which bun run services:up starts. Nothing reaches a real inbox.

Set these on the API with your provider’s SMTP details. For Mailgun:

Terminal window
SMTP_HOST=smtp.mailgun.org
SMTP_PORT=587
SMTP_USER=postmaster@mg.example.com
SMTP_PASSWORD=...
MAIL_FROM=Acme <hello@example.com>

Any provider that speaks SMTP works the same way.

  • Verify the sending domain with your provider first, and send MAIL_FROM from it. Otherwise email lands in spam.
  • Check it before you announce: ask for a sign-in link on the live site and see that it arrives.

Email goes through the job queue. A send that fails is tried again, 10 times over about 2 hours, so an outage delays email rather than losing it. After the last attempt the job is marked failed and stays in the jobs table for 30 days.

If the log says Sent "<subject>" to <address> and nothing arrives, the provider took it: look at its logs. To write emails of your own, see Send email.