Email provider
Your product can’t run without email: people verify their address before they can sign in.
On your machine
Section titled “On your machine”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.
In production
Section titled “In production”Set these on the API with your provider’s SMTP details. For Mailgun:
SMTP_HOST=smtp.mailgun.orgSMTP_PORT=587SMTP_USER=postmaster@mg.example.comSMTP_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_FROMfrom 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.
When the provider is down
Section titled “When the provider is down”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.