Configuring WordPress to Send Email with SMTP
SMTP stands for Simple Mail Transfer Protocol, and sending through an SMTP server means that you have set up a real email address on your system and you are allowing the web based script (wp_mail) to connect to the server with the appropriate account credentials.
By default, WordPress uses the PHP Mail function to send emails. However, it is not the best method and may decrease email deliverability. Emails may often arrive in the spam/junk folder. As an alternative, you can use SMTP to send emails.
In this article we’ll explain how to choose and configure an SMTP service, as well as how to integrate it into WordPress.
In this article
Choosing an SMTP Service
There is a wide range of free SMTP servers that can be set up on a mail client to deliver your emails.
A a public outgoing server is a good choice for daily communication. You can select among different free SMTP services. The most popular are:
When it comes to email marketing though – when you need to send a bulk message like a newsletter – things get much trickier.
In fact, a common SMTP server like Gmail is not designed to support such kind of mass emailing, because it relies on shared IPs and sets strict limits to the volume of messages and recipients that you can handle per day.
So in this case it’s better to use a premium SMTP service that can guarantee full deliverability of your emails.
Some examples of the paid services include:
Registering for an SMTP Service
Let’s set one of the free SMTP services. In our case, Gmail.
Google’s GMail SMTP server is a free service for anyone who has a GMail account. If you don’t have a GMail account, you can create one at the GMail account creation page.
When you’ve created the account, you’ll need to configure your mail client to use GMail for the outgoing mail server. As an example we’ll describe the configuration of the Thunderbird mail client.
Outgoing Mail (SMTP) Server: smtp.gmail.com
Use Authentication: Yes
Use Secure Connection: Yes (this can be TLS or SSL depending on your mail client)
Username: your GMail account, e.g. firstname.lastname@example.org
Password: your GMail password
Port: 465 or 587
If you use Google Apps with your domain name, you should write that email account with the Username: field, e.g. email@example.com
Choosing an SMTP Plugin
There are many WordPress plugins that help you to integrate an SMTP service into your WordPress website. Some of them are listed below, and for this article, we’ll explain about the WP Mail SMTP plugin.
Installing the WP Mail SMTP Plugin
To install the plugin please follow these steps:
Configure the Plugin
To add the SMTP details into the plugin:
|From Email||Email address you want to send emails from – firstname.lastname@example.org, for example.
|From Name||Name that your emails will be received from.
|Mailer||Choose whether you want to use the default mail function or the SMTP.
|Return Path||Check if you want to match the return path for your emails to the sending email.
|SMTP Host||Hostname for your SMTP server.
|SMTP Port||Port your server works on.
|Encryption||If you have SSL/TLS encryption available for that hostname, select it here.
|Authentication||Check if your SMTP server requires authentication.
|Username||Username for your SMTP server.
|Password||Password for your SMTP server.
Testing the Plugin
If you want to test your settings, you can go to the Send a Test Email section and enter an email address that you want to send to, then click the Send Test button.
Now WordPress is configured to work with your SMTP server.