Email Debugging for WordPress (Safely with a Mock SMTP)

WordPress Developers & Plugin Authors Intermediate 12 min read email debugging for WordPress
TL;DR

Use Mockmail’s hosted mock SMTP to capture WordPress emails (WooCommerce, Contact Form 7, membership notifications) without sending to real inboxes. Inspect HTML, text, headers, and attachments in the web UI and share a link with your team.

Why Email Debugging for WordPress Matters

Sending real test emails is risky and slow. With a hosted mock SMTP, every wp_mail() message is captured instead of delivered. You can verify templates and headers instantly—without spamming customers.


Quick Start

  1. Create an inbox at mockmail.io.
  2. In that inbox, copy your SMTP settings (host, port, username, password, encryption) from the dashboard.
  3. In WordPress, install the WP Mail SMTP plugin.

Configure WP Mail SMTP

  1. Go to Settings → WP Mail SMTP.
  2. Under Mailer, choose Other SMTP.
  3. Fill in the fields using the values shown in your Mockmail inbox:
Field Value
SMTP Host Use the host shown in Mockmail
SMTP Port Use the port shown in Mockmail
Encryption As shown in Mockmail (e.g., None/TLS)
Authentication On (if credentials are provided)
SMTP Username From Mockmail
SMTP Password From Mockmail
From Email e.g., noreply@yoursite.test (non-production)
From Name e.g., YourSite (Test)
  1. Save Settings.

Send a Test Email

  • Open WP Mail SMTP → Tools → Email Test and send a message.
  • In mockmail.io, open your inbox and confirm the message appears.

To test “real” flows: place a WooCommerce test order, submit a Contact Form 7 form, or trigger a password reset.


Inspect & Share

For each captured email you can:

  • HTML: verify layout, images, and links
  • Text: check the plain-text fallback
  • Headers: confirm From/To/Reply-To and custom headers
  • Attachments: download and review files
  • Share: copy the shareable link to show your team/stakeholders

Note: Because messages aren’t sent through a live SMTP provider, SPF/DKIM/DMARC signing/validation doesn’t apply here. Use Mockmail to validate content and headers you control; handle deliverability setup later with your real SMTP provider.


Troubleshooting

  • Email not appearing? Double-check host/port/encryption/credentials match your Mockmail inbox settings.
  • Using containers? If WordPress runs in Docker while Mockmail is hosted, use the host from Mockmail, not localhost.
  • Plugin bypassing SMTP? Some plugins call mail() directly. Ensure they use wp_mail() or provide SMTP options.
  • From address wrong? Set it explicitly in WP Mail SMTP → Settings to avoid defaults like wordpress@hostname.

Next step: When templates look good in Mockmail, switch WP Mail SMTP to your production SMTP provider and handle SPF/DKIM/DMARC there.
Need more basics? See /features/mock-smtp or start at /how-to for other guides.

Frequently Asked Questions

Will emails ever leave my development environment?

No. Mockmail captures all SMTP traffic but never delivers externally. It's a true mock server designed for testing only.

Can I debug WooCommerce order emails?

Yes. Point WooCommerce to Mockmail via WP Mail SMTP and inspect HTML, headers, and attachments for every order confirmation.

How do I share a captured email with my team?

Every captured email has a shareable link. Just copy the URL from the Mockmail web UI and send it to teammates.

Does this work with Contact Form 7 and other plugins?

Yes. Any plugin using wp_mail() or SMTP will send to Mockmail when configured via WP Mail SMTP.

Can I test SPF and DKIM headers?

Absolutely. Mockmail displays all headers, including authentication results, so you can verify SPF/DKIM/DMARC before going to production.

Start testing emails safely

Use Mockmail for free to test and debug emails with zero risk.

Register