WordPress not sending email issue must be fixed immediately. If you don’t do so, you will not be able to use the “forgot password” feature of WP. Sometimes, you may forget the password of the WP admin. There are two ways to reset the same – change it manually by running a SQL query in PHPMyAdmin or similar software, or log in to the DB server with the help of a terminal and run the query or use the “forgot password” option of the WordPress CMS.
What happens if you click this link, enter the email address in the form, and click the submit button? The WP CMS will send a reset password link to your inbox. You must click on this link and enter the new passphrase.
Another reason why you must fix WP not sending email error is that you won’t get comments notifications via mail. User comments are an excellent feature of the WP content management system. When a user fills out the comment form and submits it, WP will send a “new comment” email. Sometimes, a user might be in desperate need of help regarding a thing you’re an expert on.
When someone fills out the contact form on your WP site and clicks the submit button, the form will invoke the mail function. If the email function is not working, you will never know who has filled out the form and submitted it.
Email is an important function of a WordPress-powered eCommerce store. To get alerts on new orders, the mail system must function properly.
You can fix the “WP not sending mail” problem without installing a plugin or buying an SMTP service which many SMTP plugins will prompt you to do so.
Log in to your server via SSH. Now, check if sendmail
service is running using this command – systemctl status sendmail.service
. If the service is not active, start it using the command systemctl start sendmail.service
. If the service can’t be started by systemctl
, you should install sendmail
.
Run this command to install sendmail sudo dnf install
sendmail, or sudo apt-get install sendmail
. Once sendmail
has been installed, start the service using the command systemctl start sendmail.service
. Now, to make sure the Linux OS will run the service automatically when you restart the server, run the command systemctl enable sendmail.service
.
Once the service is running, uncomment the sendmail path in the php.ini file on the server. If you don’t know the location of the file, run this command find / -name php.ini
in the terminal and to find the path of sendmail
binary, run the command which sendmail
.
![PHP INI Sendmail](https://wptls.com/wp-content/uploads/2021/12/PHP-INI-Sendmail-1024x268.webp)
A web server may throw a 504 error when users fill out the form on a WordPress site that uses the mail function. This error occurs when sendmail encounters an error while sending an email, and PHP doesn’t send a response to the web server. One of the most common errors is the “my unqualified host name” error which appears in the mail log file in the var directory of the server. You can fix this error by changing the hostname using the hostname your_hostname
command. Replace your_hostname with a fully qualified hostname.