MailHog in MAMP PRO – Test, capture, and debug emails locally

Set up MailHog in MAMP PRO to safely test WordPress forms and PHP mail functions

Mailhog

Using MailHog in MAMP PRO

How it helps you

"As a web developer, I want to safely test all email functions when developing and testing web projects and WordPress sites — without any test messages being sent to real recipients. With the MailHog solution integrated into MAMP PRO, I can capture, debug, and analyze emails locally, including headers, body, and attachments. This saves time, prevents accidental customer mailings, and ensures that registration forms, contact forms, password resets, or newsletter integrations work flawlessly before I push a project live."

 

MailHog is an open-source tool for testing email functionality in web applications. It’s directly integrated into MAMP PRO and allows you to capture emails locally that are sent via mail() or SMTP, and view them in a web interface — without any real emails leaving your system.

 

What Is MailHog Useful For?

  • Test email functionality without actually sending messages.
  • Check WordPress & CMS forms (e.g., contact form, password reset).
  • Improve development safety: No risk of test emails accidentally reaching real customers.
  • Debugging: Inspect mail headers, body, and encoding directly.

 

Tips & Best Practices

  • Always enable during development: Prevents accidental emails to real recipients.
  • Use with WordPress: Safely test registration, password reset, and contact forms locally.
  • Simulate errors: In MailHog’s settings, you can simulate error conditions (e.g., to test behavior during sending issues).
  • No persistent storage: By default, emails aren’t stored permanently – save logs if needed.

 

Enable MailHog

  1. In MAMP PRO, open Settings → Server → MailHog.
  2. Activate Use MailHog server.
    • MailHog starts and stops automatically with the servers (via the Start/Stop button).
  3. Optional: Adjust the log file (default: /Applications/MAMP/logs/mailhog.log).

Default ports:

  • SMTP: 1025
  • Web GUI: 8025

When MailHog is active, these ports are displayed in the upper-right corner of the MAMP PRO preferences interface.

 

Using MailHog

  • Capture emails: Any email sent through mail() or PHP scripts is automatically caught by MailHog.
  • Open the GUI: Visit http://localhost:8025/mailhog in your browser → you’ll see all captured emails here.
  • Inspect content: Headers, plaintext, HTML, and attachments are displayed directly.

 

Why It Matters

With MailHog, you can safely test, debug, and analyze emails in MAMP PRO — without the risk of messages being sent externally. Especially when developing with WordPress or Laravel, it’s an indispensable tool.

EMPTY

EMPTY