WordPress Not Sending Mail

I’m not able to send mail from WordPress using Local on a Windows 10 machine using any tests or when creating a new user and so on. I have a SendGrid account and have their plugin installed. I see no reason why I could have configured SendGrid wrong as I have the skillset and tried both API and SMTP methods but who knows?.

I didn’t even know about MailCatcher until today and it shows two mail items sent out three days ago which is confusing because I didn’t even install and configure SendGrid then.

What is this MailCatcher and its purpose? Any ideas how to debug further?

Hey Clinton,

I see the mailcather focused in centralizing and easing the process of debugging and developing e-mails. It’s much easier to focus on the content than to have the mail server in between. Also, there’s a whole lot of complexity when it comes to IPs sending e-mails.

About Sendgrid, you best double check the configurations on the API (even using Postman or something) to see if its alright, as I already used Sendgrid with Local and it worked perfectly.
Might have some issue with Firewalls or something, but it’s best to check the confs first.
I really recommend Postman

Hey Clinton,

I use Mailgun’s plugin with Local, and emails still get delivered. If you’re pulling a site into Local, URLs in the DB are rewritten to the .local URL, and sometimes this will rewrite the URL stored in Mailgun’s/Sendgrid’s plugin settings.

The idea behind MailHog is that emails sent from local dev environments aren’t always delivered reliably. Further, you don’t want to accidentally email users/customers if your code goes haywire. MailHog catches these emails, preventing them from sending, and gives you a browser-based approach to preview them.

Does that help?

1 Like

Postman. Thanks for reminding me…
I’ve gone to the SendGrid account and configured all of the settings I can and told Windows Firewall to trust flywheel.exe so today I learn more.

1 Like

I haven’t pulled a site into Local so that’s not a concern but good to know about the circumstances to stay mindful of.

I don’t think MailHog is even working correctly yet. It only caught two mails that were sent out when changing passwords --before-- I installed SendGrid and such to send mail out. Just moments ago I created a new user and that user (one of my email accounts) has received no mail and MailHog knows nothing about it either.

I’ve gone to the SendGrid account and configured all of the settings I can and told Windows Firewall to trust flywheel.exe . I rebooted last night and now the former two records in MailHog are gone.

Its also pertinent to note that when I load MailHog it flashes what looks like a debug or error page that contains something that is red. It goes by too fast to read and then loads the screen with the MailHog logo that is supposed to show me the contents of the inbox.

MailHog won’t get mail that gets sent by Sendgrid.

MailHog gets every e-mail sent with the wp_mail() function, and SendGrid doesn’t use it.
The Sendgrip API works almost like an SMTP, with authentication and delivery made by Sendgrid itself, not Wordpress. So there’s no way MailHog can catch that :smiley:
Also, if you correctly apply SendGrid with it’s Plugin and everything, it overwrites wp_mail() so every mail that would be sent by Wordpress, gets sent by Sendgrid instead.

Still FUBAR

This is from a “Check Mail” plugin
SendMail path (UNIX): /usr/bin/env /usr/local/bin/catchmail -f mailcatcher@flywheel.local

Will Flywheel allow and send email itself? The 3rd party CheckMail plugin is using PHPMailer with SMTPDebug set true but there’s been no error output and again, everything seems to be sending but never received.

Is your domain verified through SendGrid? There’s a chance your mail server is rejecting the emails if SendGrid isn’t setup properly.

Two days ago I was working on a site that uses Mailgun (and verified-domain sending), and emails delivered fine. Mailgun’s plugin hooks into wp_mail: does SendGrid’s plugin?

If you disable all mail plugins, does MailHog work reliably?