In this guide, we will set up the recommended WP SMTP Mail plugin for WordPress for sending emails. You will have to pay an extra amount to use third-party email services or use the SMTP server for this task.
In this article, I will show you how to use an SMTP server to send WordPress emails using WP SMTP Mail.
The Problem with WordPress Emails
WordPress uses the mail function in PHP to send emails. Some shared hosting providers do not have this function configured properly, or they have disabled it entirely to avoid abuse. This is the reason, which leads to your WordPress emails not being delivered.
The alternative solution, in this case, is to use a third-party email service to send out your emails. You can use services like Sendgrid, Google Apps for work, or Mailgun.
You will have to pay for your account, and the price will change according to how many users/accounts you create or how many emails you send.
What if we told you that there is an option that you are probably already paying for it?
Using Email Accounts by Your Host
As you can see or may have heard, most WordPress hosting providers offer email services for every domain you host with them. You can create email accounts with your own domain name, for example, YOURNAME@YOURSITE.COM
First, you must set up an email account. We’ll show how to set up an email account in cPanel for the purposes of this example. Although the hosting service provider may employ a different account management system, the basic steps are often the same.
Log in to your hosting account and select “Accounts” from the Email Section.
After that, will show you a simple form where you need to fill out the information required to create your email account.
Since you will be using this account to send WordPress emails, we recommend that you create an email account like wordpress@example.com. You will replace example.com with your domain name.
Now that you have created your email account, you are ready to use it in WordPress. But before the start, you will need the following information from your hosting service provider:
- SMTP Host for your email address.
- SMTP Port for secure login.
Most likely, there will be an article providing this information on the help page of your host’s website. You should ask the hosting support center for this information if you can’t find it.
Using Your Branded Email Address in WordPress
This step will require installing and activating the plugin called WP Mail SMTP to send emails.
- In the WordPress dashboard, click “Plugins” and then click “Add New” in the left pane
- Search for: WP Mail SMTP plugin.
- Click the Install button, then Activate.
- After it’s installed and activated, navigate to the Plugins page in your WordPress dashboard.
Now go to “Settings” and click Email to configure the plugin settings.
Now you will want to enter the email address you just created. Then after that, you can add a “name from” which will be used as the sender’s name.
If you don’t add a “name from“, it will use the default WordPress plugin.
Here, you need to choose the mailer. Go ahead and click on the “Other SMTP” option to select it.
Don't forget to select the “Return Path” option by checking the box. This option sets the return path to match the sender’s email address. If you leave it unchecked, bounced messages and non-delivery receipts will be lost.
Next, you need to set up SMTP options.
In this step, you need to enter the SMTP host and port. Also, you can get this information from your hosting provider. The SMTP host is often mail.yourdomain.com (replace yourdomain.com with your domain name). ِFor SMTP Port 465 is commonly used.
Next, choose encryption. Most WordPress hosting companies support SSL and TLS. Recommend using the TLS option when available.
This time, turn on the authentication toggle and provide your SMTP username and password. Simply put, your email address is also your SMTP username.
Your password is stored in plain text and is not safe. We will make it more secure later.
Now click the button to “Save Settings” to save your changes.
Testing Your SMTP Settings
After you have set up WP Mail SMTP to send emails, we will test to see if everything works fine or not. Through the plugin’s settings page, click on the “Email Test” tab.
You must enter the email address you want to use to receive test emails. This might be any accessible, valid email address. To continue, click the “Send Email” button after that.
WP Mail SMTP is now sending an email message using the SMTP settings you entered. When an email is sent successfully, you will see a success message.
Securing Your Email Password
In the WP MAIL SMTP settings you need to input your email account password. Normally this password is stored in plain text, which is unsafe.
Through the plugin also provides you an option to make it more secure. To do that, you will need to add some code to your wp-config.php file. If you have not done this before. Do not worry! We will make our way out here.
Open your FTP client or the file manager application in cPanel and connect to your website. Open your website’s root folder. There, look for the wp-config.php file. Once the file has been found, you must edit it using any plain text editor. Use Notepad, TextEdit, or another plain text editor.
You need to look for the line that says “That’s all, stop editing! Happy blogging!” and add the following code just before it.
- define( 'WPMS_ON', true );
- define( 'WPMS_SMTP_PASS', 'your_password' );
Remember to replace “your password” with the correct SMTP password. Save and upload your wp-config.php file back to the server.
Visit your WordPress admin area and go to “Settings” in WP Mail SMTP page. After that, scroll down to the SMTP options section and you will see the password field is now disabled.
Troubleshooting WordPress Email Issues
The most frequent cause for errors in sending emails using SMTP is an incorrect SMTP host or port. You must correctly enter the host and port settings that your hosting provider has provided.
Make sure you choose the correct encryption method. Usually, SSL works in most environments. If your emails are not delivered, we advise that you check your web host.
FAQ
I hope this article helped you learn What is Sender Policy Framework (SPF)
Add your comment here. {Any negative comment will be deleted.}