Sending mail to nobody
The subject isn’t about me (hopefully). A bit of a departure from web-specific topics. This set of links can help developers regardless of language. I hope this is of some interest, please let me know if you find this useful.
Email. Despite all of the newer more efficient ways we have to communicate, email continues to be the main channel for communication online. So it isn’t uncommon for an application or system to have some requirement to send emails. And while there are services which will send email for us (we will explore those another day), sometimes we are sending emails directly via SMTP.
If that is the case, and your system needs to send emails to a list of people, maybe customers, or even just a customer at a time with transactional emails, you will need to test that mechanism at some point. And you certainly don’t want to be sending test emails to real people.
Maybe you can replace real emails with fake ones, or send everything to a single test email address, and if your needs are simple that may work. These products and services suggest an alternative option: using a test SMTP server.
MailSlurper is a Go-based, open source test SMTP server which can be easily configured and deployed or simply run locally on your workstation. It is self contained with a SQLite database, and provides a nice web-based UI to inspect all of the emails sent through the system. Would be good for developers testing mailing functionality inside of a more enterprise shop.
Mailtrap is the service version of this concept, providing an SMTP endpoint and the ability to view sent emails. They have a free tier for personal projects and provide plans scaling up to millions of sent test emails. In addition to catching your outgoing mail, it allows you to inspect the mail rendering and assess spam scores.
DevelMail feels like a slightly more basic version of the same concept. However, in this case the free account allows for unlimited messages, it will just only keep the most recent 10MB. Granted that isn’t a huge number of emails, it may well be enough to inspect what you need. And it will keep any automated emails from non-production environments out of your users inboxes.