Email has decades of anti-spam machinery in front of it. Mail sent naively from your own server mostly lands in spam or is dropped silently, and nothing tells you it happened.

Use a sending service

Resend, Postmark, SendGrid, Amazon SES. They maintain sending reputation, handle bounces, and have generous free tiers. Do not send directly from your application server over SMTP — that is precisely the pattern spam filters exist to distrust.

Set up the DNS records

Three records, added at your domain registrar. Your provider gives you the exact values.

  • SPF — which servers may send as your domain.
  • DKIM — a cryptographic signature proving the message wasn't altered in transit.
  • DMARC — what receivers should do when the first two fail, and where to send reports.

Without these, spam folder. With them, inbox. This is the highest-value hour in the entire topic.

Send in the background

Never send email during a web request. Providers have slow minutes, and a slow provider becomes a hanging page load. Queue it, respond to the user, send afterwards.

email-setup.txt
Stack: <stack>. I need to send <password resets / receipts /
notifications>, roughly <n> per day.

- One provider recommendation for that volume, with the cost.
- The integration, with sending off the request path.
- The exact DNS records I need and what each one does.
- Both plain-text and HTML parts.
- Bounce and complaint handling — what do I do when one comes back?

Then: how do I test all this without emailing real people?

That last question matters more than it sounds. Use the provider's test mode or a catch-all inbox — the alternative is emailing real customers your debugging.

Writing the actual email

Plain and short beats designed and long, especially for transactional mail. One clear action. A reply-to address a human actually reads. An unsubscribe link on anything not strictly transactional — legally required in most places, and good manners everywhere.

Send one to a Gmail account and an Outlook account, and check the spam folder in both. That's your delivery test, and it takes two minutes.