Linked List: Fake or Mock SMTP Servers for Email Testing

Today there are many ways to reach your customers or friends. But email still seems to be a significant channel. Open format, standards, and federated networks make it very popular. So most all applications have to integrate with email infrastructure to send emails. If you are an indie developer or a small startup, you will probably not be running your SMTP server. You will have an email provider who will access the STMP server to send emails. Some may provide a wrapper web API to send the email. But I prefer SMTP access, as it's a standard, and you can use the tools already present to integrate.

To test SMTP integration, you can either send emails using the production SMTP or you can run a test SMTP server just for testing. But its not easy for every developer in your team to do that or make it part of your CI/CD. This is where Fake or Mock SMTP servers play a role. They can run on a developers machine and expose an SMTP endpoint to connect and send test emails. They usually have web access to view the test emails to check formatting etc, manually. Some of them also expose a web API to retrieve the content for CI/CD integration. Here are some of my favorite mock SMTP servers.

MailHog

MailHog

MailHog is a simple FOSS tool that can be downloaded as a single binary file. Once you run it exposes a SMTP server and a Webserver. The web part has a UI where you manually check the emails. It also comes with restful API for integration. It has an optional feature of releasing the emails to real SMTP server. Useful for test and delivery kind of setup.

Web and API based SMTP testing

MailHog

Fake SMTP Server

A simple SMTP Server for Testing purposes. Emails are stored in an in-memory database and rendered in a Web UI. The Fake SMTP Server is a simple SMTP server which is designed for development purposes. The server collects all received emails, stores the emails in an in-memory database and provides access to the emails via a web interface.

fake-smtp-server

It's a simple FOSS application available as a jar. You will need java installed to run it. If you prefer docker image, you can use that too. You can configure things like port, authentication etc. Very easy to use. has a web UI and restful API.

MailSlurper

MailSlurper is a small SMTP mail server that slurps mail into oblivion! MailSlurper is perfect for individual developers or small teams writing mail-enabled applications that wish to test email functionality without the risk or hassle of installing and configuring a full blown email server. It's simple to use! Simply setup MailSlurper, configure your code and/or application server to send mail through the address where MailSlurper is running, and start sending emails! MailSlurper will capture those emails into a database for you to view at your leisure.

MailSlurper

MailSlurper is a single binary FOSS tool. It comes with a web UI and restful API. It's easy to use.

What's your favorite email testing tool?


You can read this blog using RSS Feed. But if you are the person who loves getting emails, then you can join my readers by signing up.

Join 2,242 other subscribers

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.