Mailhog within local

Hello,
I have added an email subscription form plugin to the site. I noticed that under tools in the local app, mailhog is installed.
I hoped that when testing my site, completing the email subscription form would allow mailhog to catch the notification that is sent. But looking at mailhog, inbox is zero.
I am running the site via Live Link. Does mailhog work when using live link? Does it only work if used locally?
So either I have misunderstood mailhog or not configured it (I have done no configuration) or the email subscription plugin (Icegram) is not working as I expected - that has been configured to send requests to an account.
Any ideas?
Regards

Mailhog should work over Live Links.

If we’re being very explicit about what Mailhog is doing, it’s capturing all emails that the site sends using the system’s SMTP mailer.

I know this means things like php’s mail functionality which is what WordPress’ wp_mail() function uses.

What this means is that if the site isn’t using those things to send email, then Mailhog won’t capture it.

This can sometimes happen if you are sending things via an API call to something like a dedicated email sending service like Mailgun or Sendgrid. I think that in most cases, those tools don’t send emails in dev environments because they disable sending to their api if they sense that the site is no longer in a production environment.

I’ve never tried Icegram, but I would double-check to see if there’s a way to determine how it is sending emails, and if there are settings around using it in a sandbox way, or possibly the exact way that it is sending email.

Thanks for this @ben.turner
I think the problem may be down to me (shock!!). If I use the plugin form as a widget then subscribing does cause emails to be generated and so captured by mailhog.
Because I did not like the layout of the form, I copied the html code and added that amended code to a custom html block. Using this form does not generate any emails.
Regards,
John

1 Like

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.