Wordpress not sending emails (and it’s not DNS)

Hello there!

My company owns a server with 10 sites, all using Cloudflare traffic, except for the emails.
In one of them, is a community/streaming Wordpress platform, which uses emails ALOT.
The server sends emails for email confirmation, passwords changes, informations, marketing, etc.

I know that Cloudflare does not support email traffic, that’s why we have greyed the mail.domain.pt.

Everything worked fine for the last year. But since last week, I can’t manage to send emails with the server with the exact same configuration.

I use WP SMTP Mail plugin to force some of the WP configs. Everytime that I use the plugin to send a test email, with Cloudflare activated on domain.pt and www.domain.pt, the request takes forever to load and is unable to send the test email giving me a 524 Cloudflare timeout error.

When I deactivate Cloudflare, all emails on the website are back to normal and the email test page of WP SMTP Mail plugin works and sends the email in less than a second… So it can’t be a exceed of the 100seconds limit for the timeout.

Any thoughts on this?

The normal configuration as follows:
mail.domain.pt points to original server
MX points to original server
domain.pt points to Cloudflare
www.domain.pt points to Cloudflare

Cloudflare Configs
wp-admin with Cloudflare Cache Bypass

Much appreciated!

Which delivery method are you using for WP SMTP?

I’m currently using “Other SMTP” on WP SMTP Plugin, due to my custom mail server and configs.

We are through a Enterprise SSL, on ports 465 and 993 consequently.

We changed nothing for the past week to make it stop working…

That shouldn’t be due to Cloudflare, as SMTP would be outbound via a direct connection. I’ve used the “Other SMTP” option in that plugin (WP Mail SMTP by WP Forms), but now use Mailgun. SMTP had worked for me.

What are you doing to deactivate Cloudflare? Is it the “Pause Cloudflare on Site” feature?

I do have some questions on DNS. You say some things point to “Original Server.” What’s the original server? ‘mail’ subdomain should be an “A” record with an IP address, but MX records are different and point to a hostname.

The A record “mail” is always GREYED pointing to dedicated ip server.
The A record “domain.pt” is always going through cloudflare.
The Cname “www” is pointing to the domain name, and it’s going through cloudflare aswell…

Note that both “www” and “domain.pt” are not going though Cloudflare right now, because I needed the emails to works ASAP, so I had to temporarily deactivate Cloudflare.

I know you said that everything had been working fine up until now, and it works when Cloudflare is deactivated. And you’ve probably already done this, but can you double check your plugin settings to make sure it’s using the proper SMTP server?

I checked mine, and unsurprisingly, it’s retained my SMTP settings while I’ve since switched to the Mailgun option.

At this point, I can’t troubleshoot the issue because I don’t know the domain name and it’s probably bypassing Cloudflare.

Do you see anything in the server error logs? Worst case, you can try enabling PHP debugging and see if there’s any info there. I don’t think WP Mail SMTP has a debugging option unless it actually generates an error onscreen.

1 Like

Hello @AlexRod

I suspect here that SSL configuration could be the issue (this is the only scenario that Cloudflare could be related from my understanding) can you please upload your SSL settings here so we can check that too?

The other thing I suggest here is to deactivate all the plugins (except the one that you send the emails) and set up your wordpress to the default theme, and check with Cloudflare enabled.
and set the WP Debug Options to check the error logs

Let’s check all the above options

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