WordPress Not Sending Emails

Hosting Environment:

  • NameCheap’s Stellar Plus shared hosting plan
  • Email is via a Microsoft 365 subscription using a subdomain that I own.

Issue:

  • My WordPress site suddenly wouldn’t send emails anymore via its default PHP Mailer. I have no idea what might have triggered it to stop working.
  • I tried the solutions from many resources that I’ve found which said it would fix the issue, but unfortunately none did. And the majority of the posts recommended that the SMTP method be used, but in my particular situation the PHP Mailer comes a lot more handy than configuring SMTP.
  • In the cPanel’s Email Accounts section, I see bounce back emails in my default admin mailbox with subject either being “rejected by local scanning code“, or “Mail delivery failed: returning message to sender” with a “No Such User Here” message in the bounce back, but the destination email was listed correctly.

Solution:

In cPanel, go to Email Routing, select the email domain and change the Configure Email Routing to Remote Mail Exchanger from Automatically Detect Configuration (recommended).

Thoughts:

I have indeed double checked to make sure that my domain’s Zone Records were all set up correctly both on the NameCheap side and the Microsoft 365 side and I’ve been able to successfully send and receive emails for quite a while, so this was likely not the issue. However, I think that either something changed in the email exchanger system that confused the automatic configuration, or my recent removal and cleanup of old domains/subdomains on the Microsoft 365 side had made some differences that I didn’t notice.

Keywords: WordPress PHP Mailer not sending emails; No Such User Here; NameCheap.