Does Mailhog intercept or also let through email?

Hi,
I’m developing a plugin that send WooCommerce order emails to different email addresses based on the country selection in the checkout. I want to test this and see the emails, Mailhog is perfect for this.

My question is; If emails are send by wp_mail() is the destination rerouted to Mailhog or are they also going to the email address I intended in the plugin?

TLDR: Is Mailhog a man-in-the-middle or is it the destination?

Cheers!

@Nils,

It’s the destination. MailHog replaces the default PHP sendmail functionality in Local which is what wp_mail() uses. :slight_smile:

With that said, if you install a plugin that changes wp_mail() to use SMTP or some type of direct API to an email service such as SendGrid, MailHog will not intercept the e-mail.

Hi Clay,

Thanks for the reply! This is exactly what is was looking for.
I indeed want to use SMTP in the future so I’ll keep in mind!

Cheers!

1 Like