Navigate:
All ReposMailHog
~$MAILHO0.1%

MailHog: Web and API based SMTP testing

Captures development SMTP traffic with web and API interfaces.

LIVE RANKINGS • 06:51 AM • STEADY
OVERALL
#132
58
DEVELOPER TOOLS
#25
10
30 DAY RANKING TREND
ovr#132
·Devel#25
STARS
15.6K
FORKS
1.1K
DOWNLOADS
24.8K
7D STARS
+16
7D FORKS
0
See Repo:
Share:

Learn more about MailHog

MailHog is a testing utility written in Go that implements an ESMTP server for capturing outgoing email during development. It runs as a standalone binary without installation requirements across multiple platforms, accepting SMTP connections on a configurable port while storing messages in memory or persistent backends. The tool provides both a web UI for viewing messages and HTTP APIs for programmatic access, supporting standard email features including MIME multipart messages, RFC2047 encoded headers, and SMTP authentication. Common deployment scenarios include local development environments, Docker containers, and CI/CD pipelines where email testing is needed without external mail server dependencies.


1

Single Portable Binary

Runs as a standalone Go binary without installation or runtime dependencies across Linux, macOS, FreeBSD, and Windows. Deploy to any environment without managing language runtimes or system packages.

2

Flexible Storage Backends

Supports in-memory storage for fast temporary testing, plus MongoDB and file-based persistence for retaining messages across restarts. Switch storage strategies without changing application code.

3

Dual Access Interfaces

Offers both web-based and API access for viewing and managing captured emails. The browser interface provides visual inspection while the REST API enables automated testing workflows, allowing integration into CI/CD pipelines and test suites seamlessly.


import smtplib
from email.mime.text import MIMEText

msg = MIMEText("Test email body")
msg['Subject'] = "Test Email"
msg['From'] = "sender@example.com"
msg['To'] = "recipient@example.com"

with smtplib.SMTP('localhost', 1025) as server:
    server.send_message(msg)


vv1.0.1

Maintenance release with no breaking changes; switches to official Golang Docker image and adds Ubuntu snap packaging.

  • Update Docker deployments to use the new official Golang base image instead of the previous custom image.
  • Install via Ubuntu snap if preferred; release notes do not specify security fixes or functional changes.
vv1.0.0

Maintenance release bumping to 1.0.0 with dependency updates, maildir storage fixes, and TLS websocket support; no breaking changes specified.

  • Update mgo dependency and note that vendor directory was temporarily removed due to build issues.
  • Add `-version` flag for version checks and fix maildir storage bug with leading `\r\n` characters.
vv0.2.1

Maintenance release fixing UTF-8 attachment encoding, header case sensitivity, and vendoring all dependencies; adds WebSocket support.

  • Upgrade to Go 1.6 or later as dependencies are now vendored and mgo import path is updated.
  • Enable WebSocket support for real-time message updates and verify attachment names render correctly in UTF-8.


[ EXPLORE MORE ]

Related Repositories

Discover similar tools and frameworks used by developers