Set up MailHog development SMTP server

MailHog is a simple development SMPT server that can be used to test sending of emails.

1 Install

Execute on the command line:

cd /usr/local/bin
sudo wget -O /usr/local/bin/mailhog
sudo chmod a+x /usr/local/bin/mailhog

2 Start

As we don’t always need it in a project, MailHog is to be started when needed.

Execute on the command line:


You should receive output similar to the following:

2020/06/17 09:42:57 Using in-memory storage
2020/06/17 09:42:57 [SMTP] Binding to address:
[HTTP] Binding to address:
2020/06/17 09:42:57 Serving under
Creating API v1 with WebPath:
Creating API v2 with WebPath:

The server will run in the foreground, and you can stop it with Control-C.

If needed, find the additional options by executing:

mailhog --help

3 Test

When started, web interface will be available at Open it to confirm that it is working.

4 Configure in a project

To use it in a web application, configure the mailer DSN to smtp://