WordPress

How to setup email in WordPress

Your WordPress email may not be delivered if it is not set right. This post explains how to setup your WordPress email using SMTP configurations.

Many beginning WordPress users discovered early that their sites do not deliver emails to the inboxes. This failure to deliver emails could cause them to lose potential customers or readers. Another important consequence of this failure is that they or their readers do not receive the email resetting passwords. In this post, I will describe how you can setup your email so that your WordPress site will send all the emails successfully.

The case of the missing emails

It is common for WordPress site owners to install contact forms plugins to gather feedback from the site visitors. You will find that you can send messages through the form successfully after clicking the submit button. However, the submitted contact form may not reach your inbox. This discrepancy could be serious to your site management if your site members or yourself could not reset the site passwords.

What is going on here?

Submitting a form in WordPress
Submitting a form in WordPress.
Contact form shows that the email was sent successfully
Contact form shows that the email was sent successfully.

How WordPress sends your emails, by default

Email is complicated. What happens here is that in the default setup, WordPress sends emails through the PHP mail() function. This function requires the server to be set up correctly to work. Most servers, by default, were not set up to handle mail delivery. A consequence of this was that although WordPress could send the emails successfully, the receiving email servers, such as the Gmail or Hotmail servers, rejected these emails because the emails did not contain certain important identification details.

The right way to setup WordPress email

Since it is often not possible for you to set up your servers, an alternate way, which fortunately, is also free and much more reliable, is to use Gmail, Hotmail and other common email providers to send the emails for you. That is, you can use your free email accounts to send emails for your WordPress sites.

To do this, you will need to set up the SMTP server in your WordPress site. SMTP is the abbreviation for Simple Mail Transfer Protocol. The easiest way to do this is to install an SMTP plugin, such as the WP Mail SMTP by WPForms and setup the SMTP account credentials.

Using WP Mail SMTP by WPForms to setup WordPress email
Using WP Mail SMTP by WPForms to setup WordPress email

The sections below describes the configurations to enter into the *WP Mail SMTP by WPForms* plugin for selected email solution providers. The exact information could also be used for other similar plugins. Lastly, always remember to test the email delivery after setting the SMTP server by checking that the email was delivered to your inbox.

Gmail

To setup WordPress email using the free Gmail account, make sure to select Other SMTP mailer and enter these information into the plugin.

  • SMTP Host: smtp.gmail.com
  • Encryption: TLS
  • Port: 587
  • Username: Your free @gmail
  • Password: Password of the above username
Using Gmail to setup WordPress email SMTP server
Using Gmail to setup WordPress email SMTP server

One more thing you need to set to enable this to work is to enable your Gmail to allow less secure apps(your own hosted WordPress) to access your Gmail account. To do this, access your Gmail account settings.

This method is not as secure because it requires you to allow access by less secure apps. You can use Gmail with greater security by using the Google Gmail mailer although it is more challenging to set up.

Test your email delivery

Now, you can go back to your SMTP plugin and test your email delivery. There is a limit of 100 emails per message that you can send using this method. If you expect to send more than this, then you will need to subscribe to paid mailer services such as Sendinblue or Mailgun.

Always test your email delivery and check that it arrives at your inbox to ensure that your WordPress email is setup correctly.
Always test your email delivery and check that it arrives at your inbox to ensure that your WordPress email is setup correctly.

Hotmail/Outlook

You can use the free version of the Hotmail/Outlook account to setup WordPress email.

  • SMTP Host: smtp-mail.outlook.com
  • Encryption: TLS
  • Port: 587
  • Username: Your free @hotmail or @outlook email account
  • Password: Password of the above username
Using hotmail or outlook to setup WordPress email SMTP server.
Using hotmail or outlook to setup WordPress email SMTP server.

Microsoft 365

Using Microsoft 365 to setup WordPress email.

  • SMTP Host: smtp.office365.com
  • Encryption: TLS
  • Port: 587
  • Username: User name that you signed up Microsoft 365
  • Password: Password of the above username

Sendinblue

Sendinblue is a client email marketing tool. It provides free account that you can use indefinitely. When you upgrade to a paid plan, you can send email with a higher quota. For Sendinblue account, you can use the API key to setup your WordPress email.

Alternatively, you can use the SMTP settings to setup your WordPress email.

  • SMTP Host: smtp-relay.sendinblue.com
  • Encryption: TLS
  • Port: 587
  • Username: Your Sendinblue login username
  • Password: You need to retrieve this password from the SMTP/API page under master password

Mailgun

Mailgun is a transactional email API provider. A transational email is an email that is sent when an event occurs. Some examples of transaction emails are the welcome emails that you received when you sign up for new accounts, or the emails to reset passwords when you click the button to reset your account passwords.

Mailgun has a free plan that you can sign up for. After signing into the dashboard, click Add New Domain. In the domain field, make sure to enter a subdomain instead of your primary domain. As an example, I chose mg.classroomt.net. You could choose any other subdomain, for example, mail.classroomt.net.

How Mailgun works?

The reason you do this is that you could use Mailgun to send newsletter to your email lists. However, your email domain has a reputation. If you send your newsletters that fail certain specifications, your email domain may be blacklisted. Once it is blacklisted, your emails will land in the Junk mailbox and your email subscribers may not see your emails at all. By using a subdomain for your email domain, you can choose to change your email domain if the current one is blacklisted for some reasons. Imagine if this was your primary domain. That’s why I wrote early in this article that email is complicated.

Setting up Mailgun with DNS server

After adding the email domain in Mailgun, you need to add the Mailgun DNS records to your DNS servers before verifying. The diagram shows the records from Mailgun that you need to copy and paste into your CloudFlare DNS settings. If your DNS registrar is not CloudFlare, your view may differ from the image.

An additional note is that you should not expose your DNS settings to the public. These records here are temporary, for demo purposes.

Setting the DNS records of Mailgun in your DNS provider.
Setting the DNS records of Mailgun in your DNS provider.

After filling up the DNS records on CloudFlare, click Verify DNS Settings on Mailgun Domain settings page. If everything is successful, you should see the records showing up on the right under Current value.

If your Mailgun DNS records are set correctly, the right column will be populated.
If your Mailgun DNS records are set correctly, the right column will be populated.

The final step you need to do is to obtain the SMTP user and password from SMTP credentials. The default SMTP user is

  • SMTP user: postmaster@mg.classroomt.net
  • Password: Click Reset and copy the generated password that appears on the screen.
Mailgun offers dynamically generated password to connect to the SMTP server of the WordPress email.
Mailgun offers dynamically generated password to connect to the SMTP server of the WordPress email.

Now, copy these values into the SMTP login credentials of your WordPress plugin and attempt the Email Test. It is useful to note that you can use any email username to send your forms. Replying to an email sent here will not be received by anyone. As such, it is helpful to include the statement to inform the email receipients not to reply to this email.

Which solution should I choose to setup my WordPress email?

The above listed setups are not the only available in the market. There are many other free and paid solutions. How do you decide which to choose?

For new website owners, your usage of emails would most probably be low and for transactional purposes. Using a free solution such as Gmail or Hotmail/Outlook would be fine. However, if you are planning an email marketing campaign, or sending newsletters to your audience, you will probably want to start with Sendinblue or Mailgun, since these platforms contain more features that let you monitor your email activities. Both of these platforms offer free accounts for indefinite period of usage. When you think your needs increase(and congratulations to you), you can then scale up to their paid accounts. You would not need to transfer your existing email database to the new platform and redo setups.

Share this post

Facebook

You can find out more about our web design and hosting plans

Try it free for 14 days.

stay informed!

Subscribe to our newsletter for WordPress tips and more.