Skip to content

Mail Testing

JessicaOPRD edited this page Aug 23, 2021 · 4 revisions

It's been very helpful for me to set up a localhost mail server for testing emails that don't actually reach anyone except me. Not only does this allow me to safely accidentally send 80 emails to a single person, but it also lets me set up an infinite number of fake accounts with "@localhost" email addresses (which I can access to verify tokens, password resets, etc).

Bringing this setup to teammates hasn't been easy. There are a lot of raised eyebrows when I ask, "Can you set up a mail server for us that only sends mail to whitelisted dev accounts? Or something like that?"

Regardless here's a round-up of possible mail test tooling:

Tool Type Notes
hMailServer SMTP server ⚪ What I currently use ⚪ Microsoft only ⚪ Can "misconfigure" (e.g. not finish setup) so that outgoing mail never leaves your box ⚪ Can access mail queue through interface or send email to an account that you can access via an email client ⚪ Setup is tricky ⚪ Feels outdated ⚪ Seems to have once run on Microsoft's flavor of SQLite (SQL Server Compact Edition), but it's deprecated and in latest install I've had to use a local MS SQL Server install
MailHog SMTP server ⚪ Cross-platform ⚪ Designed with development/testing in mind ⚪ SMTP server is purposely fake ⚪ Access through web browser, unsure if you can connect to email client ⚪ Many plugins available ⚪ Docker support
MailCatcher SMTP server ⚪ Precursor to MailHog ⚪ Built on Ruby on Rails ⚪ Access through web browser
Mailtrap Cloud service ⚪ Safe SMTP server available for testing ⚪ Advanced tooling like HTML check and spam score ⚪ Likely $24/mo for small teams ⚪ I could see us quickly maxing out the email boxes (limited to 50-1000 emails) with debugging messages, so a secondary localhost SMTP solution is likely needed