If you noticed that your WordPress website is unable to send emails, it could mean there is a problem with the email server in your web host. You can easily resolve this issue by installing Gmail SMTP plugin.
Using a free Google account, you can configure Gmail SMTP to send out emails from your WordPress site. This is usually a straightforward process and should not take more than 30 minutes to complete.
How Gmail SMTP solves your email problem
For several reasons (too many to cover in this guide), WordPress may not be able to send emails using your webhost mail server.
One popular reason is that webhosts restrict the use of PHP Mail function because it is very easy to abuse and has been used extensively by spammers. But since this is the function WordPress uses to send emails, if it is restricted in your server, you will be unable to send emails.
However, when you install Gmail SMTP plugin, WordPress would no longer need to send emails through your webhost email server. Instead, emails will be sent using Gmail servers, and this removes the problem.
Also, instead of using the PHP Mail function, which is very easy to abuse, Gmail SMTP uses PHPMailer Library, which is much more secure.
How To Setup Gmail SMTP Plugin
To use Gmail SMTP plugin, you would need to have a Gmail account. If this is a free account, note that you can only send out 500 emails per day. This amount is however sufficient for most users.
If you use Google Apps for Work, your daily limit jumps to 10,000 emails per day.
Installing The Plugin
To install Gmail SMTP, login to your WordPress dashboard.
Place your mouse pointer over Plugins and select Add New.
In the search box, type in Gmail SMTP. When it appears in the search result, click Install Now and wait a few moments.
When the installation completes, the button will change to “Activate”. Click on this button to activate the plugin.
After the plugin activates, you will be taken to the plugins page. Search for Gmail SMTP and click Settings.
Authorizing Gmail SMTP to send using your account
Next, you have to authorize Gmail SMTP to send emails using your Gmail account. To do this, you have to create a web application and generate API keys. Don’t worry, this process is a lot simpler than it sounds.
Click the link to create a web application.
You’ll be taken to Google login page. Login with the account you want to use for sending emails.
In the application registration page, select yes on both items and click Agree and Continue.
Next, click Go to credentials.
Your “Authorized Redirect URI” is provided in your Gmail SMTP plugin page. Go there and copy it. Ensure you copy the entire link by dragging your mouse across.
Paste this redirect URI in your Gmail credential page, and click Create Client ID.
In the next step, leave the email address set to the address you want to use, and enter a name for your product. Any name like “WordPress Email” would do.
Next click Continue.
After clicking continue, your Client ID would be generated. Copy this ID and paste it in the “Client ID” input box in Gmail SMTP Plugin page.
Next, you need to input your Client Secret. To get this, click Done in your Google Credential creation page.
You will be taken to a credential management page where you can see the one you just created. Click on the name of the credential.
On the next page, you would see your Client Secret at the top.
Copy this and paste it in the Client secret input box in Gmail SMTP plugin.
Next, enter the Gmail address you are using in the “OAuth Email Address” and “From Email Address” Input boxes.
Enter your From Name.
In “Type of Encryption”, select TLS, and enter 587 in the “SMTP Port” input box.
Lastly, click Save Changes.
After saving the changes, a “Grant Permission” button will appear at the bottom of the page. Click on it to authorize Gmail SMTP.
In the permission page, click Allow.
You would be taken back to your plugin where you should see an “Access Granted” message at the top. Also, SMTP status should now show “Connected”.
Voila! You’re done.
Testing Your SMTP Plugin
After completing the authorization step above, you would need to test to see if WordPress is able to send emails using Gmail SMTP plugin.
To perform this test, switch to the “Test Email” tab.
Fill out the fields and click Send Email.
After clicking send, the plugin will display a log showing how the email was sent out, and you should receive the email shortly.
What to do if Gmail SMTP plugin cannot connect to Gmail server
Sometimes, Gmail SMTP may not send emails, even after correctly authorizing it to use your Gmail account.
You can usually see the source of the error in the log displayed after clicking “Send” on your test email. One common error is the plugin not being able to connect to Gmail servers.
The first time I installed this plugin, here is the error I got.
On the second line, you can see that the plugin could not connect with Gmail using port 587.
If you get this error, it likely means your web host is blocking that port. Simply contact them and ask them to open port 587, and you would be able to send emails.
As an alternative to consulting your web host, you can change the connection type to SSL and the port to 465. After this change, send another test email to see if it goes.
I hope this article has helped you to understand how to resolve email issues by using Gmail SMTP plugin to send WordPress emails.
If you have any questions or observations, please drop them in the comments section below. And if you need help setting up or troubleshooting Gmail SMTP, you may request our assistance.