How to Install MailHog on Windows 11

MailHog is a development tool that provides a SMTP server for testing email functionality during development. In this tutorial, we will guide you on how to install MailHog on Windows 11.

Prerequisites

Installation Process

  1. Open Command Prompt or PowerShell by right-clicking on the Start menu and selecting the appropriate option.

  2. Check that Go programming language is installed on your computer by typing the following command:

    go version
    

    If you see a version number, then Go is installed. Otherwise, install Go and add the Go bin directory to your PATH environment variable.

  3. Check that Git is installed on your computer by typing the following command:

    git --version
    

    If you see a version number, then Git is installed. Otherwise, install Git on your computer.

  4. Run the following command in the Command Prompt or PowerShell:

    go get github.com/mailhog/MailHog
    

    This command downloads the MailHog code from GitHub and installs the binary in your Go bin directory.

  5. Navigate to the Go bin directory by typing the following command:

    cd $env:GOPATH/bin
    

    This command takes you to the Go bin directory where the MailHog binary is located.

  6. Run MailHog by typing the following command:

    MailHog
    

    This command starts MailHog and you should see output similar to the following:

    [MailHog] 2022/02/23 16:26:56 Loaded configuration from environment variable.
    [MailHog] 2022/02/23 16:26:56 Using in-memory storage
    [MailHog] 2022/02/23 16:26:56 Starting SMTP server on :1025
    [MailHog] 2022/02/23 16:26:56 Starting API server on :8025
    [MailHog] 2022/02/23 16:26:56 HTTP API listening on http://127.0.0.1:8025
    [MailHog] 2022/02/23 16:26:56 SMTP server listening on 0.0.0.0:1025
    
  7. To access the MailHog web interface, open a web browser and go to http://127.0.0.1:8025.

Congratulations! You have successfully installed MailHog on Windows 11. You can now easily test email functionality during development.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!