Is Cloudflare not sending WordPress emails? Or are you seeing server timeouts when using SMTP to send email?
Sometimes moving to Cloudflare can cause problems with email sending in WordPress, but it’s easy to fix.
We’ll show you how below. But first, let’s figure out exactly what kind of Cloudflare email problem you have.
Does Cloudflare Affect Email?
Cloudflare doesn’t directly affect email because it doesn’t handle SMTP traffic.
If you aren’t receiving any emails after switching to Cloudflare, it’s likely that there’s a problem with your DNS records.
During the Cloudflare setup wizard, Cloudflare tries to copy the DNS records from your old host. You should compare the DNS records at your old provider with the details that Cloudflare has pulled in during the set-up procedure, paying special attention to the
If you have an
A record for mail, it shouldn’t be proxied with an orange cloud icon. We’ll talk about this more in section 2.
In this article, we’ll move on from general email issues and talk specifically about Cloudflare email issues with WordPress websites.
How to Fix Cloudflare Not Sending WordPress Emails
We’re going to look at 2 different WordPress Cloudflare issues and show you how to fix them.
- Not Receiving WordPress Emails on Cloudflare (or Emails Going to Spam)
- Fix WordPress Timeouts with SMTP on Cloudflare
First, follow these step by step instructions to fix WordPress email deliverability issues.
1: Not Receiving WordPress Emails After Switching to Cloudflare (Or Emails Going to Spam)
If you’re having trouble receiving WordPress emails on Cloudflare, it’s easy to fix!
By default, WordPress sends emails through your web server using the
wp_mail() function. This method is super basic, and the emails aren’t authenticated. So WordPress emails frequently get lost (or filed in the Junk Mail).
This isn’t directly related to Cloudflare, but changing your DNS configuration can sometimes produce unexpected results.
When your emails are routed through a separate email service, they’ll get the authentication they need to get through spam filters.
That will improve deliverability for your contact form notifications, WooCommerce store order emails, and other plugins.
Let’s install the plugin now to solve the email deliverability problem you’re having.
Install WP Mail SMTP
To start, download the zip file from your WP Mail SMTP account so you can install it on your website. You’ll find it in the Downloads tab.
Next, open up your WordPress dashboard. Head to the Plugins page and upload the plugin to your WordPress site.
If you’re not sure how to do this, check out this guide to installing a plugin in WordPress.
As soon as you activate the plugin, the WP Mail SMTP Setup Wizard will open.
You can also re-start the wizard at any time by clicking the Launch Setup Wizard button in your WP Mail SMTP settings. Just know that re-starting the wizard later might reset your SMTP settings.
Choose Your Email Service Provider
Now we can choose a new provider to handle outgoing WordPress emails.
If you have a small site, you can use Gmail or Other SMTP. The Other SMTP option lets you use any mail server that you already have access to.
Click the Let’s Get Started button to begin.
On the next screen, click the mailer you want to use in the list.
When you’ve chosen your mailer, open up our documentation to complete the setup steps on the provider’s side:
- Gmail (G-suite or Gmail)
- Amazon SES
- Zoho Mail
- Other SMTP
You can open the documentation in a new tab, then come back to this guide when you’re done.
Create DNS Records on Cloudflare
When you first set up Cloudflare, it copies your DNS entries from your old DNS provider. Now you have a new email provider, you might have been prompted to create some new DNS entries.
You can easily create these records by logging in to your Cloudflare account and selecting your domain.
Then you can go ahead and click the DNS icon to add the DNS records.
We’ll add a brief description of the records below.
Keep in mind that each provider has slightly different requirements. Not all records are required. If you aren’t prompted to create a certain type of record for your email provider, it’s likely that it doesn’t require it.
DKIM electronically signs the emails sent from your domain.
Some providers need a DKIM so the email header can be validated, which proves your message is genuine and not spoofed.
The SPF record lists the servers that are authorized to send email from your domain.
It’s important that you only have 1 SPF record in Cloudflare.
You may already have an SPF record if you’re using other services with your domain. For example, if you’re sending email newsletters from an email address at your domain, you might have an SPF record for that already.
So to add your email provider, you’ll want to merge the content with the existing record.
To find out how to do that, read this simple guide on how to merge multiple SPF records.
A DMARC record is responsible for routing mail that’s been flagged as spam by the mail server. It also sends reports to tell you the outcome of spam filtering.
Your provider should give you all of the details you need to create a DMARC record. If you need more help, check out this article on how to create a DMARC record. It includes a generic DMARC record that will work on most domains.
CNAME, TXT, MX
Some mailer services also require these records, although they’re less common than the other 3. If you don’t see these in your email provider’s setup instructions, you shouldn’t create them.
Send a Test Email From WordPress
Now you have your new mailer set up, you can go ahead and send a test email from WP Mail SMTP to check Cloudflare email in from WordPress.
Click the Email Test tab to start.
And then send your test email!
If everything’s set up correctly, you’ll see a green message.
If WP Mail SMTP detects any issues, it’ll show a warning.
Below the warning, you’ll see information on the improvements you can make. For example, WP Mail SMTP will tell you if it can’t find your DMARC record.
Next, let’s look at the steps to follow if you experience a server timeout or a Cloudflare 524 error with SMTP.
2: WordPress Timeouts When Sending Email via SMTP on Cloudflare
If you’ve just switched to Cloudflare, or you’ve just set up SMTP for WordPress, you might notice timeouts when using Other SMTP in WP Mail SMTP.
When this happens, you’ll see errors like:
- There was a problem while sending the test email.
- Could not authenticate your SMTP account.
- Could not connect to the SMTP host.
- SMTP connect() failed.
Cloudflare may also display a request timeout or gateway error. The error code could be 500, 504, or 524.
WordPress timeouts with SMTP are usually caused by an incorrect proxy setting for your mail server
A record in Cloudflare. Since Cloudflare can’t proxy SMTP traffic, we need to turn off the orange cloud for that line in your DNS.
To do that, open up the Cloudflare dashboard and open up the DNS records.
Look for the
A record pointing to your mail server. This will typically be called mail.
If the cloud icon orange and says Proxied, it means Cloudflare is trying to proxy your email traffic. This won’t work, which is why your WordPress SMTP is timing out.
You can see we have an orange cloud here to show that Cloudflare is trying to proxy SMTP traffc.
To fix this, you’ll want to edit the record.
Click on the cloud once to disable the proxy setting for the mail
A record. When the cloud is gray, it will say DNS Only.
Click the blue Save button to save the change.
Now go back to WP Mail SMTP and try to send another test email to check that the timeout issue is fixed.
If you still have problems, take care to check the SMTP login details and the port number in your WP Mail SMTP settings.
FAQ on Cloudflare WordPress Emails
Let’s look at some frequently asked questions about Cloudflare DNS and WordPress.
Do I Need to Create a PTR Record in Cloudflare?
No. PTR records are helpful for reverse DNS lookups, but you don’t usually need to create them. PTR records are normally handled by whoever manages your mail server. In most cases, this will be your web hosting company.
Do I Need to Use the Cloudflare WordPress Plugin for SMTP?
No. The plugin gives you extra details on your Cloudflare account, but you don’t need to install it for WP Mail SMTP to work.
Ready to fix your emails? Get started today with the best WordPress SMTP plugin. WP Mail SMTP Elite includes full White Glove Setup and offers a 14-day money-back guarantee.