How to Configure Outgoing Email in WordPress Using the WP-SMTP Plugin
The WP-SMTP plugin gives you plenty of options to send emails through various services. In this article, let's explore how to configure WP-SMTP.
OPTION 1: Sending emails via Gmail SMTP
What are the benefits of using Gmail SMTP for WordPress?
In addition to the benefits supported by most wordpress hosting providers and ISPs, using Google SMTP offers several advantages such as: - A much higher email delivery success rate - No need to set up a mail server (if you are using a VPS) - Your emails are much less likely to be marked as spamHow to use Google SMTP for free?
You will need a few things prepared before starting to use the SMTP service, including: - A Gmail or G Suite account - Access to your hosting control panel #### Step 1: Get Google Mail Server SMTP configuration details You can find the Google SMTP configuration details here: - SMTP Server: smtp.gmail.com - SMTP Username: Your full Gmail (email address), for example [email protected] - SMTP Password: The App Password for your Gmail account. - SMTP Port: 587 - TLS/SSL: Required. #### Step 2: Create an App Password for your Gmail account To create an App Password for Gmail, visit https://myaccount.google.com/ and sign in with your Gmail account. Here, you first need to enable 2-Step Verification.
Then follow the instructions to turn on 2-Step Verification. Once 2-Step Verification is enabled, proceed to create an App Password.
After clicking Generate, you will receive an App Password, and you need to save this password for later use.
Option 2: SMTP using the SendGrid API
One of the best third-party services is SendGrid; when you register an account, you can send up to 100 emails per day for free. After registering successfully, go to the dashboard and select Settings / API key
Then name it and create a new API key.
Copy this API key code (note that it is only displayed once), paste it into the WP-SMTP plugin in the next section, and run a test.
The advantage of using an API key is that you can customize the displayed sender instead of being limited to just a Gmail address (however, the server technical headers will still show that the email was sent via SendGrid if the recipient inspects the technical details).
Installing the SMTP Plugin and Configuring SMTP for WordPress
We will proceed to install and activate the WP Mail SMTP by WPForms plugin. If you do not know how to install plugins in WordPress, you can refer to the following article: How to install plugins for WordPress
After installing and activating the plugin, let's proceed to configure SMTP.
Fill in the fields as follows:
- SMTP Host – enter smtp.gmail.com.
- SMTP Port – Google SMTP defaults to 465 for SSL and 587 for TLS.
- Encryption – You should always use encryption. Select the option that matches the port number you are using.
- Authentication – Select On because SMTP authentication needs to be enabled.
- Username – Your Gmail address.
- Password – The Gmail App Password you created in the previous step.
After completing the configuration, click Save Settings to save your changes. Next, we will test whether sending emails works successfully.
Here, Send To is the email address that will receive the test email. After entering the details, click Send Test. If you see a notification like the image below, it was successful.
