WordPress not sending email: fixing contact forms, resets and orders
When WordPress doesn’t send email, the problem is almost always how it sends it: by default it uses PHP’s mail() function, without authentication, and email providers distrust or discard those messages. The most reliable solution is to set up delivery over SMTP, using an email account on your own domain and an SMTP plugin.
This article is for anyone with a WordPress site where the contact form, the password reset or the order notices don’t arrive. It explains the common causes, how to test and how to set up SMTP step by step.
Why does WordPress not send email?
WordPress sends all messages through an internal function called wp_mail(). Without any extra configuration, it hands the email to the server’s PHP, which passes it on without logging in to any account. The result depends on how the server and the recipient handle that sending.
| Cause | How it shows up |
|---|---|
PHP mail() function unavailable or limited |
No email arrives, not even in the spam folder |
| Message marked as spam | The email arrives, but in the spam or junk folder |
Sender from another domain (for example, @gmail.com in the From field) |
Missing or flagged as spam, because the sender’s domain doesn’t match the server that sent it |
| SPF or DKIM missing or wrong | Messages rejected or sent to spam |
| Form plugin misconfigured | Only the form fails, while the password reset works |
| Wrong recipient or full mailbox | The email disappears only for one specific address |
Step 1: check whether the problem is general or only the form
Before changing anything, find out how widespread the problem is.
- Request a password reset for a user at
/wp-login.php?action=lostpassword, using an email address you can open. - See whether the message arrives, including in the spam folder.
- Send a test message through the contact form.
If none arrive, the problem is with WordPress’s sending overall, and setting up SMTP (step 4) fixes it. If only the form fails, review the settings of the form plugin itself (step 3).
Step 2: check the sender and the recipient
Many form plugins have a “From” or “Sender” field and a “To” field. Two mistakes are very common:
- Sender from another domain. Putting the visitor’s email or an
@gmail.comaddress in the From field makes providers suspicious, because the server sending it isn’t Gmail’s. The safest option is to use an address on your domain, such ascontact@yourdomain.com, and put the visitor’s email in the reply field (Reply-To). - Recipient typed incorrectly. Check the destination address and whether the mailbox is full.
By default, WordPress sends its notices from an address in the format wordpress@yourdomain.com. If that address doesn’t exist, some error responses go nowhere. An SMTP plugin lets you replace it with a real sender.
Step 3: check your domain’s SPF and DKIM
SPF and DKIM are DNS records that tell email providers which servers are allowed to send email on behalf of your domain. Without them, messages often end up in spam. In cPanel, if the Email Deliverability option is available, it shows whether these records are correct for the domain and suggests the fix.
To understand the topic in more detail, read email going to spam: SPF, DKIM and DMARC.
Step 4: set up SMTP delivery
Using SMTP means WordPress starts logging in to a real email account on your domain, the same way an email program does. This greatly improves delivery.
Before you begin: make a copy of your site, since you’re going to install a plugin. The article how to back up WordPress shows how.
Create or choose the email account
Use an account on your domain created just for this, for example site@yourdomain.com. If you don’t have one yet, see how to create an email account in cPanel.
Note the connection details
In cPanel, open Email Accounts and, for the account you want, click Connect Devices. The screen shows the outgoing server, the ports and the security type. Note these values and use exactly the ones shown there. The examples below are generic:
| Field | Example (check in your cPanel) |
|---|---|
| SMTP server | mail.yourdomain.com |
| Port and security | 465 with SSL/TLS or 587 with STARTTLS |
| Username | The full address, such as site@yourdomain.com |
| Password | The password for that email account |
Install and configure the plugin
- In the WordPress dashboard, go to Plugins > Add New and install an SMTP plugin. Some well-known ones are WP Mail SMTP, FluentSMTP and Post SMTP. If you need help, see how to install a plugin in WordPress.
- Open the plugin’s settings and choose the option for other SMTP (custom SMTP), instead of a specific provider.
- Enter the server, port, security type, username and password you noted.
- Turn on authentication (SMTP Auth).
- In From Email, enter the same account you configured, for example
site@yourdomain.com. If there is an option to force this sender, turn it on. - Save.
Avoid storing the password in code files when the plugin offers another way. Use a password for this account only, so you can change it without affecting your main mailbox.
Step 5: send a test email
Most SMTP plugins have a test email tab. Send a message to an address of yours and check whether it arrives and in which folder.
- Arrived in the inbox: it worked. Repeat the test through the contact form and the password reset.
- Authentication error message: review the username (full address) and password.
- Connection error or timeout: switch between the ports listed in your cPanel and the matching security type. On some plans, certain outgoing ports may be restricted; if that’s the case, your hosting support can confirm which one to use.
- Arrived in spam: go back to step 3 and check SPF and DKIM.
When to ask support for help
If the test failed even though the settings are correct, gather the information before writing:
- The exact error message shown by the plugin.
- The email address and domain you used.
- The approximate time of the test.
With that, support can look at the sending record more quickly. If you need help, contact us at /contato/.
Frequently asked questions
The contact form says “sent successfully,” but the email doesn’t arrive. Why?
The success message only means WordPress handed the email to the server, not that the recipient received it. The email may have been blocked or gone to spam. Check the spam folder and set up SMTP delivery.
Do I need a plugin to send email from WordPress?
It isn’t required, but it’s the simplest way to set up SMTP without touching code. The plugin only stores the connection details and makes WordPress authenticate with the email account.
Can I use a Gmail account as the sender?
You can, but it requires its own Gmail setup, such as an app password, and sending then depends on another service. For a site with its own domain, the simplest option is to use an email account on the same domain.
Why doesn’t the password reset reach the user?
The causes are the same as for the form: unauthenticated sending, spam or an invalid sender. Set up SMTP and ask the user to check the spam folder too.
Do the order emails from my store use this setup too?
Yes. Store plugins, such as WooCommerce, use WordPress’s sending. Once SMTP is set up, order notices go out through it, as long as the store doesn’t have a different sending method defined.
Which port should I use, 465 or 587?
Use the one your cPanel shows on the email client configuration screen, with the matching security type. In general, 465 works with SSL/TLS and 587 works with STARTTLS.
Will changing the sender fix the problem?
It helps when the sender was from another domain, but it isn’t always enough. The ideal is to combine a sender from your domain, authenticated SMTP and correct SPF and DKIM records.
How do I tell whether the problem is with WordPress or with the email account?
Send a message to the account through webmail or an email program. If it works there but WordPress fails, the problem is in the site’s configuration.