Videos
Check out our tutorial video series.
Verify Email Delivery with MailHog - the Portable Email Testing Tool for App Developers. Install with Docker or Golang & Test Accurately with mhsendmail.
You might want to satisfy your curiosity by finding out the status of each email you send to a customer. This will help you determine if the client got the email or not.. Using some helpful email testing tools, you can use a program called MailHog to verify that your emails were delivered.
Read on to learn more about MailHog and to know if it is worth it.
MailHog is a tool for testing emails that hides a bogus SMTP server. It does not need a specific backend implementation because it encapsulates the SMTP protocol with extensions. A portable tool made with Golang is called MailHog. Any platform that supports Golang binary files can run it, and installation is as easy as copying and launching.
MailHog's target market is app developers. They can test the app's email sending more effectively using this tool. You can send emails to any recipient using MailHog, which also stores them for display.
MailHog is a tool that, as was stated earlier, does not require installation. However, downloading and installation are still necessary. The options for doing this are numerous.
Visit GitHub to download MailHog.
Choose the MailHog version that is compatible with your platform from GitHub and download it. You can now run it without any outside dependencies.
Mailhog can be started in a docker container using docker compose.
A Docker app running in multiple containers is called Compose. To configure services for your application, use a YAML file in this instance. To configure MailHog with this tool, make a file called docker-compose.yml and copy the following lines into it:
Start mailhog by running docker-compose up -d mailhog. This creates the container and launches it. Docker will instantly download the MailHog image if it's not present.
Alternatively you can run MailHog as a golang package. Installing Golang is the first step. Depending on your platform, you can do this in several ways using the options presented here. Now you can install MailHog with:
Following that, you can use the tool by performing the following:
MailHog uses mhsendmail as a sendmail substitute. It guarantees that emails will be sent through the MailHog-managed localhost:1025 SMTP server. Should it be required for testing, install MailHog. The inability to accidentally send something outside of your computer as a result of incorrect SMTP server settings is one advantage of using mhsendmail. Consequently, be sure to install it as well.
As a result, be sure to install it too.
Then, add the path to your system so that it is reachable after downloading it from GitHub. Here's how it appears in Ubuntu as an example:
After installing it, you must connect your application to MailHog and set it up to use mhsendmail rather than sendmail. This is how it appears, for, in the php.ini file.
Try sending a message using the CLI in the following manner:
You must send an email from your app, terminal, or even PowerShell to test how MailHog works.
The following CL script will send an email using the current PHP settings. As previously mentioned, it requires altering the sendmail path in the php.ini configuration file.
MailHog is typically a helpful tool for testing the email-sending capabilities of your app. Although it doesn't have many features, you can still retrieve your emails while storing them using the API.
It only needs a few adjustments to be set up; installation is not necessary. There are other options if you require a professional solution besides MailHog. Here are some options you can choose from:
Check out our tutorial video series.
Email and SMS guides for automation and testing.
View github project code for multiple languages.
Latest posts from the MailSlurp team.
Test, build, and automate messaging with a free MailSlurp account.