When it comes to troubleshooting WordPress not sending emails, this can sometimes be a little tricky. Why? Because many managed WordPress hosts do not provide traditional email hosting.

At Kinsta we route transactional emails via SendGrid for you. A few examples of transactional emails include new user registration emails, password reset emails, WooCommerce order notifications, etc. Basically, the essential emails that are required for site functionality or anything that isn’t marketing related. This means you can typically get up and going without having to worry about email.

However, our relay service via SendGrid isn’t meant for sending bulk emails. We also have limits on how many transactional emails you can send per day to prevent spam/abuse.

Therefore, if you need complete control over your DNS records (DKIM) or are having trouble with emails going out, it can be beneficial to configure your own WordPress with a third-party SMTP provider (transactional email service).

Today we’ll show you how to configure SendGrid in WordPress to send emails.

Send your transactional emails in style. 😎 Here's a step by step tutorial on how to set up @SendGrid on your WordPress site. Click to Tweet

What is SendGrid?

SendGrid (now owned by Twilio) is used by some of the biggest names in the industry such as Uber, Spotify, Yelp, Airbnb, and even Kinsta. It originally started out as a transactional email SMTP and API serviced designed for developers. However, they now also offer email marketing features as well. So you can use them for one or the other or both. Today we’ll be focusing on the transactional side of things, as that is what most of you are probably trying to get up and running.

SendGrid has a 30-day free trial in which you can send up to 40,000 emails. After that, you can continue the free trial forever for free and send up to 100 emails/day.

If you need more emails than that, their Essentials plan starts at $14.95/month and you can send up to 40,000 emails per month. The cost per extra email is $0.001. But you can also upgrade to a higher plan to save more money.

A few additional benefits include:

  • Ability to use Web API or SMTP to deliver emails. The Web API is faster and includes functionality for managing user unsubscribes, managing IPs, templating emails, and more.
  • Improve deliverability rates to hit users inboxes with domain and link customization, whether sending from shared IP pools or a dedicated IP.
  • Eliminate domain spoofing and phishing emails with our custom SPF and DKIM record creation.
  • Benefit from continuous mail flow through our secure, distributed, and redundant data centers.
  • Live and searchable logs.

Create a SendGrid Account and API Key

The first thing you will need to do is create a SendGrid account and generate your API key. Follow the steps below.

Step 1

First, signup for a free trial at SendGrid.com. Then verify your account by clicking on the confirmation email you receive.

SendGrid confirmation email

SendGrid confirmation email

Step 2

Once you are in, we highly recommend setting up two-factor authentication. Email delivery and routing are very important, and the last thing you want is for someone to hack your account. This adds an extra layer of protection to your account. You can do this under “Settings” → “Two-Factor Authentication.”

They give you two options: The Authy App (recommended) or text message (SMS).

SendGrid two-factor authentication

SendGrid two-factor authentication

Step 3

Next, you will need to generate your SendGrid API key. Click into “Settings” → “API Keys.” Then click on “Create API Key.”

SendGrid create API key

SendGrid create API key

Step 4

Give your API a name you can recognize. This can be anything. Select “Full Access” and click on “Create & View.”

SendGrid create API key

SendGrid create API key

You will want to copy your API key and save it somewhere safe as they won’t show it to you again. You will need this to configure the plugins below.

SendGrid API key

SendGrid API key

How to Configure SendGrid in WordPress with Official Plugin

Configuring WordPress to send emails with SendGrid is easy and only takes a few minutes.

Step 1

The first option you have is to use the free official SendGrid WordPress plugin. This is a very simple plugin and replaces the default wp_mail function to send emails. In other words, once you install the plugin and configure it, it will take control of emails going out from your site.

SendGrid WordPress plugin

SendGrid WordPress plugin

You can download it from the WordPress repository or by searching for it within your WordPress dashboard under “Plugins” → “Add New.”

Step 2

After you install the plugin, click into “Settings” → “SendGrid” in your WordPress dashboard. Enter in your SendGrid API key which you generated earlier, as well as the following:

  • Name: Name as it will appear in recipient clients.
  • Sending Address: Email address from which the message will be sent.
SendGrid credentials

SendGrid credentials

Then click “Update Settings.” And that’s it! Pretty easy right? All emails from your WordPress site will now go out via SendGrid’s mail servers.

Step 3

If you scroll down on the settings page of the SendGrid plugin you can send a test email to yourself.

SendGrid test email

SendGrid test email

Make sure to check your inbox and your spam folder to ensure the test email went through. You can also check the SendGrid activity feed.

SendGrid activity feed

SendGrid activity feed

Step 4

You should then skip down to the section to the section to configure your SendGrid domain authentication.

How to Configure SendGrid in WordPress with Post SMTP Plugin

Your other option is to configure SendGrid with the popular free Post SMTP plugin. Perhaps you are already using this plugin with your current set up, so switching it over to SendGrid should be easy.

Post SMTP WordPress plugin

Post SMTP WordPress plugin

The Post SMTP plugin is regularly updated and supports sending via SendGrid’s SMTP relay as well as SendGrid’s Web API. It currently has 100,000+ active installs with an impressive 5 out of 5-star rating.

You can download it from the WordPress repository or by searching for it within your WordPress dashboard under “Plugins” → “Add New.”

Here are a couple of reasons why you might want to use the Web API method vs SMTP:

  • SMTP connections have multiple points of failure.
  • The Web API method is typically faster with less latency than SMTP.
  • The Web API adds an additional layer of security with API keys, vs the standard credential method with SMTP.
  • Sometimes WordPress hosts block outbound connections with SMTP on ports 25, 465, and 587. Or they might not even support SMTP at all. With the Web API method, you don’t have to worry about this. Note: If you’re a Kinsta client, only port 25 is blocked.
  • Replaces the default wp_mail function to send emails.

Step 1

After you install the plugin, click on “Post SMTP” → “Start the Wizard.”

Post SMTP wizard

Post SMTP wizard

Step 2

Enter in the email address and name that you would like to “send mail as.” This is what users will see when they get an email from your site. Then click “Next.”

Post SMTP sender details

Post SMTP sender details

Step 3

We are going to use SendGrid’s API, not SMTP. But having the SMTP server will be a fallback in the future in case there is anything wrong with the API. So enter in SendGrid’s SMTP server address which is: smtp.sendgrid.net. Then click “Next.”

Struggling with downtime and WordPress problems? Kinsta is the hosting solution designed to save you time! Check out our features
Post SMTP Outgoing Mail Server Hostname

Post SMTP Outgoing Mail Server Hostname

Step 4

Select “SendGrid API” and click “Next.”

SendGrid API authentication

SendGrid API authentication

Step 5

Now back in the Post SMTP Setup, paste in your SendGrid API key which you generated earlier and click “Next.”

Post SMTP SendGrid API key

Post SMTP SendGrid API key

Step 6

You can then choose how you want to be notified when an email is failed to be delivered. Email is the default and easiest option. Post SMTP even has a Slack option. Then click “Next.”

Post SMTP email notification

Post SMTP email notification

Step 7

You can then send a test email to ensure everything is working properly. Under the Actions menu click on “Send a Test Email.”

Post SMTP test email

Post SMTP test email

Type the recipient email address you want to send a test to and click “Next.” If everything is OK you will see a “Success” message.

Post SMTP test email success

Post SMTP test email success

And that’s it! All emails from your WordPress site will now go out via SendGrid’s mail servers. Make sure to check your inbox and your spam folder to ensure the test email went through. You can also check the SendGrid activity feed.

SendGrid activity feed

SendGrid activity feed

Step 8

You should then skip down to the section below to configure your SendGrid domain authentication.

Configure SendGrid Domain Authentication

Configuring your SendGrid domain authentication will improve deliverability by proving to inbox providers that you own the domain you’re sending from. Without this, your emails might end up in the spam folder.

Step 1

In the SendGrid dashboard, click into “Settings” → “Sender Authentication.” Under the Domain Authentication section, click on “Get Started.”

SendGrid domain authentication

SendGrid domain authentication

Step 2

Pick the DNS host you are using. If you are using Kinsta DNS, you can choose Amazon Route 53. If you are using Cloudflare, then you can select Cloudflare. Then click “Next.”

DNS host

DNS host

Step 3

Enter in the domain you are sending from. You can then choose which type of security you prefer. The default and recommended option is “Use automated security.” When Enabled, SendGrid will automatically rotate your DKIM keys so that they are impossible to break. Then click “Next.”

SendGrid domain send from

SendGrid domain send from

Step 4

You will then need to add DNS records so that your email points to SendGrid. You can do this at your domain registrar or third-party DNS provider. They require three CNAME records. If you need help with this, you can always ask for assistance from your provider. If you are a Kinsta client and using our premium DNS, you can set these up within the MyKinsta dashboard. Or reach out to our support team for help.

Once you’ve added them, check the “I’ve added these records” box and click on “Verify.” Note: After adding your DNS records it might take a while to propagate. Most will only take a couple of minutes, but it could take up to 24 hours.

SendGrid DNS records

SendGrid DNS records

You should then see a “It worked!” message when the domain verification is complete.

SendGrid verified

SendGrid verified

You should be all set up now for sending emails! Remember, the plugins above replace the default wp_mail function. This means all emails going out from your site will now route through SendGrid.

Looking for good email hosting? We highly recommend G Suite.

81
Shares