WordPress Tutorials, Tips, and Resources to Help Grow Your Business
Have you noticed that you’re not receiving WordPress emails? Unfortunately, WordPress not sending emails is a common problem, but it’s easy to fix. In this tutorial, we’ll walk you through how to set up WordPress email notifications with SendGrid using WP Mail SMTP.
When Email Notifications Don’t Work
This can be a tricky problem, because you may not notice that WordPress isn’t sending form notifications until people start filling out your form, and their messages don’t reach your email inbox. You might notice form entries in your WordPress dashboard that haven’t been sent to your email, or discover there’s a problem when frustrated visitors reach out to you using social media or other methods.
Here’s what usually causes the problem…
The most common reason for missing these emails is when your WordPress hosting server isn’t configured to use the PHP mail() function.
Thankfully, you can work around this issue by using SMTP.
SMTP (Simple Mail Transfer Protocol) is the industry standard for sending emails. Unlike the PHP mail function, SMTP uses authentication which increases email deliverability. That’s why we recommend using SMTP to send emails in WordPress.
Why Use WP Mail SMTP with SendGrid?
There are many different SMTP services available, but many of these aren’t secure.
While other methods require you to store sensitive login information in your WordPress dashboard, using SendGrid in WP Mail SMTP will keep your email passwords secure.
SendGrid offers a free plan for sending up to 100 per day. For most small businesses and personal websites, that’s plenty. If you need to send more, you will likely need a paid service.
How to Find Your SendGrid API Key
Before we can configure your website to work with SendGrid, we need to set up an account and find your SendGrid API key. This key is a unique identifier and a secret token for authentication that will allow your website to interact with your account at SendGrid.
First, you’ll need to sign up for a SendGrid account by visiting their Pricing page. From here, you can choose the account type that fits your site’s needs.
For our example, we’ll be signing up for their free account (limited to 100 emails per day).
Next, you’ll need to fill out a couple forms to create your account and set up a profile.
After creating an account, click the Start button next to Integrate using our Web API or SMTP relay.
Next, you’ll be asked to choose a setup method. You can now click the Choose button under the SMTP Relay option.
On the next page, you’ll need to enter an API key name and then click Create Key.
Once the API key has been generated, you’ll be ready to go to the next step. Be sure to leave this page open, as we’ll need this API key a little later.
Using SendGrid with WP Mail SMTP to Fix WordPress Emails
Now we can get started setting up SendGrid with WP Mail SMTP on your WordPress site.
While in your WordPress dashboard, go to Settings » WP Mail SMTP.
At the top of this page, you can set the From Email and From Name. By default, these will fill with your site’s admin email and site name.
For the From Email, be sure this is set to the same email address used to set up your SendGrid account.
We also recommend enabling the Force From Email option. Since you will need the From Email in all plugins that send email to match this email address (a requirement in order for SMTP to work), this option will save you the trouble of editing the email settings throughout your site (in all form emails, etc).
You may add any From Name you’d like, and you can also choose to Force From Name to apply this setting site-wide. Unlike From Email, having a specific From Name is not critical to the plugin’s functionality. However, it will help email recipients to easily see where these emails are coming from.
Then in the Mailer field, select the SendGrid option.
Though optional, we also recommend checking the Return Path option to Set the return-path to match the From Email. That way, you’ll be notified if any messages bounce due to issues with the recipient’s email.
The last step on this page is to scroll to the SendGrid section and enter the API Key. Go ahead and flip back to the tab or window where your SendGrid account is open to copy the key you generated earlier.
After copying the key, return to the WP Mail SMTP settings and paste it into the API Key field.
Once these settings are saved, you’ll be ready to try sending a test email. To do this, click on the Email Test tab.
On this tab, you can enter any email address that you have access to and click the Send Email button.
Once the email has processed, you should see a success message.
If you check the inbox for that email address, you should also soon receive the email for this test.
Let’s finish by verifying the integration we just created. To do this, check the box labeled I’ve updated my settings and then click Next: Verify Integration.
When the next page loads, click the Verify Integration button. This will send an email to SendGrid for verification.
Once the email has arrived to SendGrid, they’ll let you know with a success message. This may take a few moments to complete.
If you’d like, you can stop here and submit a form to test email delivery. However, for long-term delivery success we recommend proceeding to the next steps to verify your domain and whitelabel email links.
Verifying Your Domain
The best way to ensure that your emails continue to deliver successfully over time is to verify your domain. In SendGrid, this is called “whitelabeling”, which means that your emails will appear to come from your own domain rather than SendGrid.
To get started on verification, you’ll need to open Settings » Whitelabels in SendGrid’s left menu or follow this link.
Then, click the + Add Domain button.
This will open a new panel, where you’ll need to enter a subdomain to use for whitelabeling. For our example, we’ll use the subdomain “em”.
– Not using “mail” as many hosting companies will already use this and it could cause conflicts.
– Not including any underscores (_) as this may not be compatible with some DNS providers
You can leave the Automated Security option set to On, then click Save.
Saving these settings will cause an overlay to appear. This will let you know that we still need to make DNS changes, which we’ll do in the next step.
After clicking Confirm, the next page will display a list of DNS records that you’ll need to add for your site.
If you have additional questions about DNS or feel unsure about making changes, please contact your site’s hosting provider.
After adding these DNS records, click the Validate Records button. DNS changes can take up to 48 hours to be recognized, so you may need to check back on this later.
In the meantime, let’s continue to the other part of whitelabeling: Email Links.
Whitelabel Email Links
Whitelabeling email links will allow any links in the emails that are sent to use your own domain, rather than SendGrid’s. This will help to further ensure delivery by keeping all links tied to your own site.
To whitelabel email links, return to Settings » Whitelabels in SendGrid’s left menu. Then, click the + Add Email Link button.
In the overlay that opens, you’ll need to enter another subdomain to be used in email links. This can be anything you like, though SendGrid’s documentation suggests “link” or “click” as good options.
For this example, we’ll use “link” as our prefix. Then you’ll need to select your domain and Save these settings.
Just as we saw in the previous step, an additional overlay will appear reminding you that DNS changes will take up to 48 hours to take effect. Go ahead an click Confirm.
On the next screen, you’ll be provided with two additional DNS records to add to your site.
After adding these records to your site’s DNS, you can check back here click the Validate Records button. Remember that this may take a while, so you may need to check back again later.
If you see any issues, we recommend setting the From Email in your form’s notification settings to the same email you set up SendGrid with.
That’s it! When WordPress can’t send emails, you’re able to fix the problem. Now you’re ready to fix WordPress email notifications with SendGrid using WP Mail SMTP.
Looking for more email notification tips? You might also want to check out our guide on How to Send Users Confirmation Emails from WordPress Forms, which will show you how to send a thank you message to anyone who fills out your form.
Don’t have WPForms yet? What are you waiting for? Get started with the most powerful WordPress forms plugin today.