You’ve set up your WordPress site, there’s just one issue. You can’t send mail. This means your contact forms don’t work, new user emails don’t work, password reset requests can’t be sent. It’s not a good situation. The good news is, there’s a pretty simple fix.
Originally published Oct 14, 2014. Updated October 20, 2017.
Signs WordPress Email Function is Broken
These are some common error messages when the standard WordPress mail isn’t working:
- WordPress Password Reset: “The e-mail could not be sent. Possible reason: your host may have disabled the mail() function.”
- Contact Form 7: “Failed to send your message. Please try later or contact the administrator by another method.”
If you aren’t seeing any error messages from the site, then your site may be sending emails, you just aren’t receiving them. In this case, then you are likely having deliverability problems. For those, read the post on Email Types & How to Actually Get Your Email Delivered.
There are usually two reasons that email is broken:
- The configuration of your server blocks the PHP mail() function from operating correctly.
- The email provider that you use doesn’t accept emails from PHP’s mail() function.
The good news is you don’t need to know which problem you have, the fix is the same.
Tired of dealing with WordPress challenges on your own?Click here to get back hours of your life each month with Worry-Free Maintenance
How to Fix Mail So You Can Send Emails Again
First, you need to login to WordPress. If you only have one account and can’t remember the password, then the only way to get in is to reset your password directly in the database. You should contact your developer or hosting provider to have them reset it. If neither of these is an option, click here for instructions for changing this yourself, but use at your own risk.
Now that you are logged in, you need to install the WP Mail SMTP plugin. This plugin will change WordPress from using php’s mail() function to using SMTP protocols.
Once you have installed and activated WP Mail SMTP, you’ll need to go to Settings > Email to configure it.
Sometimes, you can fix your email simply by installing the plugin and selecting “Use the PHP mail() function to send emails” and checking the “Set the return-path to match the From Email”.
So mark these two items and then scroll down and click on Save Changes. After saving, scroll down to Send a Test Email and enter your email address and then click on Send Test.
If you receive a bool(true) then it worked and you can stop now.
If you received a bool(false), then continue it’s time for more advanced settings.
If you get a green result but still aren’t receiving the email in your inbox, then you probably have deliverability problems. For those, read the post on Email Types & How to Actually Get Your Email Delivered.
Typically if your issue is with your mail provider, then you need to fix it with by setting up WordPress to use SMTP. You will need to use a from address registered with your mail provider. Then configure all of the settings to match those that your mail provider gives you for that email address.
Make sure to mark “Send all WordPress emails via SMTP”. Once you have entered everything as instructed by your mail provider for the from email address you entered, click on Save Changes.
Go down to Send a Test Email and enter an email address and click on Send Test. If you receive bool(true), then you are done. If not, check to make sure that you entered all of your SMTP information exactly as your mail provider gave it to you (it has to be exact).
Setting Contact Form Plugins
If you are using a contact form plug-in (such as the wonderful Contact Form 7), then you will need to set up the From: address in the contact form to be the same email as the From setup in WP Mail SMTP. If the email addresses are not the same, then the contact form will likely have errors.
Having WordPress unable to send email can be a pretty stressful situation, but the good news is that WP Mail SMTP does a great job of fixing the problem.