Skip to content

origami-network/docker-mailhog

Repository files navigation

release master latest
latest release master build latest build
pulls stars
Docker Pulls Docker Stars

MailHog - Windows Docker image

MailHog is an email testing tool for developers. Provides SMTP server, with web or API access.

Usage

This Docker image allows to use MailHog without need of installation on Windows 2016 and Windows 10. It accepts all parameters as specified by Configuring MailHog document.

Pull Docker image

Before start the image need to be pulled from the Docker Hub.

> docker pull origaminetwork/mailhog:X.X.X.Y

Where X.X.X.Y is the version of the image.

By default the container will expose:

  • SMTP on TCP port 25,
  • Web UI at URL http://<container address>/,
  • Web API at URL http://<container address>/api).

The <container address> is the IP address bind to the running instance.

Sending email from PowerShell

In order to send the email the PowerShell Send-MailMessage can be used.

PS> Send-MailMessage -From '[email protected]' -To '[email protected]' -Subject "From PowerShell" -SmtpServer <container address>

The <container address> is the IP address bind to the running instance.

Getting mails using API

In order to get mails received by the server the fallowing PowerShell command can be used.

PS> $baseUrl = 'http://<container address>/api/'
PS> Invoke-RestMethod ($baseUrl + "v2/messages")

The <container address> is the IP address bind to the running instance.

Contributing

In order to contribute to the project please fallow Contributing Guidance.

License

The project is licensed under MIT License.