The Definitive Guide to WordPress Email

0 Shares

Why is sending email so frustrating?

Few things in WordPress can be as completely infuriating and confusing as why your emails aren’t arriving at their intended destination. Or maybe they are, but they’re incomplete? Screwed up formatting? No images or video? Links stripped out? Sending just fine to Yahoo mail users but not Gmail? Adding a Cc/Bcc/Reply To breaking everything? Users getting them but not coworkers? Can’t change your From address without everything falling apart? WordPress email can be a pain sometimes.

Yes, it’s frustrating. But it’s also fixable.

To add to the general mayhem, on top of the smorgasbord of things that can go wrong, trying to Google around for a solution has no doubt hit you with a wave of technical terms. SMTP. Hosts. Ports. Mail loggers. wp_mail. Mail servers. DNS records and settings. PHP. Transactional email. OAuth protocols. APIs. Spam/security filters.

You’re most definitely not alone

As the authors of a form plugin with one of its primary and most loved features being the ability to notify people by email, WordPress email is a subject that’s very relevant to us, too. With over 1,000,000 active WordPress users and hundreds of thousands of emails sent daily through our plugin, you could even say it’s a topic that’s near and dear to us as well.

We struggle with it too.

Reliable email is as important to our business as it is to yours, and we hit a lot of the same problems early on that you’re probably experiencing right now. We have an amazing host, but we needed to track down a good dedicated email provider too. We’ve struggled with making sure our emails are going to breeze through the security filters on the receiving end of just about every email service provider out there. We’ve had to sit down and wrestle with SMTPs vs Transactional providers vs custom solutions for sending. We’ve had to switch the process up several times, but we’re happy to say that we eventually got everything ironed out.

Our users, you and many other people just like you, have struggled with WordPress email issues as well. We help hundreds of users a day through our support queue, and no small part of those are problems resulting from a breakdown of the WordPress email process or external factors. It can be difficult to tell sometimes where the root of any given issue lies, but it’s always doable. More often than not though, the issues we help users tackle are easy fixes with a little bit of background knowledge on the process.

Small wonder that WordPress email can be a frustrating world to move through when you encounter issues. Where do all these pieces fit in and how do they fit together? The good news is that you don’t have to fully understand it all. It can “just work”. A basic understanding of how email moves from Point A to Point B can be priceless though, and it doesn’t have to be hard at all to wrap your head around.

Where do all the pieces fit in and how do they fit together? The good news is that you don’t have to fully understand it all. It can “just work”. A basic understanding of how email moves from Point A to Point B can be priceless though, and it doesn’t have to be hard at all to wrap your head around.

That’s where this Definitive Guide to WordPress Email comes in. We have a vested interest in helping you through the issues you face, have been through many of them ourselves, and have helped users through the rest of them. Let us share with you what we’ve learned along the way and help you get your email working again! 🙂

How WordPress Email Works

If you have an idea of what your problem is and just want to explore possible solutions, feel free to skip on down the page. A basic understanding of how email works in WordPress can be really helpful, though!

A picture speaks a thousand words as the saying goes, so here’s a handy dandy image illustrating the life of a WordPress email:

The journey starts with wherever the email data is being collected, as you can see illustrated at the top of the image as “Source”, which can be either a plugin or default WordPress email. The wp_mail function, or simply wp_mail(), is the part of your WordPress installation itself that handles email.

Your plugin collects user data for an email and passes it off to wp_mail(). WordPress preps the data it receives, transforming it into the early stages of an actual email, and then moves it to one of several possible places to be sent out.

By default, wp_mail() passes the email data to your host. That’s the box containing mail() and PHP mail() at the bottom of the image. Your host receives the data passed from WordPress’ wp_mail() with its own mail().  They then evaluate/screen the data, and if it passes muster then it’s processed into its final email form and sent out to its destination using PHP mail().

Alternatively, you may elect to use a SMTP plugin or transactional email service to send email in place of your host. That’s illustrated by the branches of the image going off to the left and the right: Mailgun (a transactional email service) to the left, and Post SMTP (a SMTP plugin) to the right. Either will screen and process your email itself, and then send it out to its destination.

Sick of technical terms? Here’s the TL;DR

Email in WordPress is a 3 part process:

  1. Your email data is collected by the plugin of your choice or WordPress itself
  2. Plugin passes the data to WordPress for processing.
  3. WordPress passes the early stage email to your host (or SMTP/transactional service) to be “packaged” and sent.

Once your email is sent successfully, there’s still one more hurdle to clear: it has to be successfully received. That’s a potential delivery obstacle, just like dropping a pass in American football. More on this in the section below 🙂

Where can things go wrong?

Generally, problems happen in part 1 or part 3 from the section just above- there’s an issue with either the way the data is being collected, the party responsible for sending the finished email rejects it for some reason, or the receiving party’s email client refuses it/counts it as spam. There are a few different common reasons for this:

  • The collected data that will soon become an email contains errors or lacks necessary information
  • The party responsible for sending has restrictions on email data that conflict with your email configuration
  • Security filters meant to look for spam or malicious content flag your email for rejection

Here’s how you can fix your email problems

Like we said above, this doesn’t have to be frustrating and difficult. WordPress email is a complex thing to troubleshoot, but like most anything complex it can be broken down into manageable pieces.
Below, we will:

  1. Introduce a tool that will save you a ton of time troubleshooting issues
  2. Review potentially troublesome points with email data collection
  3. Look at how your email is being sent by default in WordPress and recommend better alternatives
  4. Evaluate obstacles to email being accepted on the receiving end

Make this tool your friend!

If you’ve never heard of mail logging, email troubleshooting is about to get a whole lot easier. When you ship a package through UPS/USPS/FedEx etc , you can track the package and see where it’s made stops along its route to the recipient. How cool would it be if you could do that with your WordPress email? That’s what a mail logging tool does- sort of. We’ll explore this below 🙂

We recommend and use WP Mail Logging currently. It’s available free in the WordPress.org plugin repository and is pretty darn simple to use. Just install it and you’ll see it pop up in your WordPress dashboard. Send a few emails with it installed and click into it from your dashboard. This is what you’ll see:

Mail loggers typically work by recording the activity of wp_mail(), the function we talked about in the How WordPress Email Works section above. If you submit a form or take any other action in another plugin that results in an email being sent, that email should be recorded by WP Mail Logging. How is this useful to you?

Interpreting what you see in the mail logger

  1. If no email is recorded by the logger, data was never received by wp_mail(). You likely have a problem with your email action. Skip below to Troubleshooting your email data collection.
  2. If the email is recorded with no error in the right hand column, your email data was successfully passed by wp_mail() to your host or sending party. If it wasn’t received, then there’s been a breakdown in sending or receiving the mail. Skip below to Upgrading Your Email’s Delivery and Deliverability and/or Stop Looking Like a Spambot.
  3. If the email is recorded with an error, then WP Mail Logging and the error message itself are both useful resources in helping you get the info you need to identify correct the problem.

Troubleshooting your email data collection

There are many different plugins you might be using to collect email data, including even WordPress itself in some cases. However you may be gathering the data, there are some common factors that can lead to incomplete or problematic data being collected. The end result of this is usually your host or email provider declining to send the data as an email once it’s been handed off by wp_mail(). In this section you’ll find the most common errors we see on a daily basis, and how to correct them.
If you’re using Ninja Forms, we have official documentation on sending email and a dedicated troubleshooting guide that expands on a lot of this as well. Remember you’re always more than welcome to contact us with questions too!

Make sure you check these three things:

Check 1: Be sure you have Subject and Email Message content entered

Many hosts/email providers will not send an email that contains a blank subject line or has no content included in the body of the email. If you don’t have anything entered for these, do so and then test it out.

Check 2: Clear out any text you have in the From Name or From Address settings

When WordPress passes the collected data to your host to be sent, your host is going to make certain checks before the data gets the green light to be go out as an email. These checks are meant to protect you, reducing spam and fraudulent/malicious email transmission.When you set up WordPress, you provided admin information including name and email address that your host uses to identify you. When WordPress passes your email data off to your host, it tags that data with your admin name and email. If you change the From Name and From Address settings to something other than your admin info, your host may think it’s fraudulent data they’ve received, and not send it out.

If you really need to adjust these settings, you should contact your email provider (your host or email service you’re using), explain to them what you’re up to, and let them make the necessary adjustments on their end for this to work.

Check 3: CC, BCC, and multiple recipients

Email providers have their own rules on what qualifies an email as potentially spam or fraudulent. These are commonly called spam filters, and we’ll hit on those a bit more below. Some providers have policies that are a tad on the overzealous side, and can reject email either on the sending or receiving end due to having any one of these settings defined- even though they may be perfectly legitimate email addresses.

If your email works fine without these fields but breaks with them, contact your host and you should be able to work out exactly what’s happening from their logs.

Upgrading your email’s delivery and deliverability

Remember from above that in a default WordPress environment, your collected data isn’t being sent in the form of an email until WordPress’ wp_mail() hands the data off to your host for packaging and shipping.

We use Pagely to manage our WordPress hosting needs, and they are absolutely fantastic. We can’t speak highly enough about their competence, reliability, and professionalism. That being said, we use an alternative for sending email.

The simple fact of the matter is that no matter how amazing your host is, they have many responsibilities. Email is just one small part of what they do. A service dedicated to handling email is almost always going to be an upgrade for you. If you’re seeing that your email isn’t registering errors in WP Mail Logging but still isn’t being sent, it’s time to consider a dedicated email solution.

Dedicated WordPress email solutions come in two forms: transactional email services and SMTP plugins.

Transactional email services

Transactional email services work by integrating with your WordPress site and replacing the wp_mail() feature with their own. Many offer a fully featured WordPress plugin for easy integration. The downside to these services are usually cost, but a little searching will reveal that many do have free tiers of service or at the very least free trial periods for evaluation. The upside is huge: turning over the responsibility of sending your email to a team of specialists dedicated to one thing. Making sure your email gets where it’s going.

Here are three examples that have both free service options and a wordpress.org plugin for easy installation:

Mailgun

We use Mailgun extensively and recommend them highly. We even have> a guide to get started with Mailgun. Their free tier allows for 200 emails daily, which is a little low for many but perfect for testing purposes and low volume websites.

SendGrid

SendGrid is a very popular email marketing service with a reputation for dependability and reliability. They’re a full service solution with a support team standing by if you face delivery issues. While they don’t have a free service tier, they do have a free trial period and plans start as low as $10USD for 40k monthly emails sent.

Postmark

Postmark is a dedicated WordPress service that also offers full support for any snags you may encounter. They offer 25k free email “credits” to begin with each new account, and pricing starts at around $10 per 10k emails monthly after that.

SMTP email plugins

Simple Mail Transfer Protocol or SMTP plugins in WordPress modify wp_mail() to hand the collected WordPress email data over to their service instead of your host. While SMTP providers are usually smaller and less involved from a business perspective than a full blown transactional service provider, they’re also typically free and a big step up from the WordPress default. Getting started is as simple as installing a plugin.

Here are three examples with great track records for WordPress users:

Post SMTP Mailer/Email Log

Post SMTP is a modern fork of the older but very popular Postman SMTP plugin. Post’s emphasis is on security and simplicity, and features its own built-in mail logger functionality.

Easy WP SMTP

Easy WP SMTP is a very popular service with over 200,000 active WordPress installs. Installation is easy and the plugin itself is highly configurable for your individual needs. It comes packaged with extensive documentation and testing/debugging procedures for any issues.

WP Mail Bank

A professionally designed plugin from Tech-Banker, WP Mail Bank has a user base of more than 50,000 active installs. Installation is very simple and the plugin itself features an array of configuration options to meet your needs. It also features built-in testing functionality.

Have an issue specifically with Ninja Forms email? Try Ninja Mail!

Ninja Mail is a new service that we’ve developed to take over the sending of Ninja Forms email. We’re working on upgrading this to handle all WordPress email similar to the SMTP and transactional services mentioned above. For now though, if you’re having issues with Ninja Forms email not working, install Ninja Mail. Nine times out of ten this is all you need to do.

To find Ninja Mail, simply navigate to your Ninja Forms dashboard within WordPress. Make sure you’re updated to at least v3.3.4 and you’ll see a banner for it:

Stop looking Like a Spambot (and having your email blocked by service providers)

The final obstacle for an email on its journey to its destination is the security filters put in place by the receiving email client. For example if you’re sending mail to a Gmail account, Gmail has filters in place that every incoming mail must pass through before hitting the target inbox. If your email lands on the wrong side of these then it can be marked as spam or rejected outright. Understanding a little bit about them can save you time and frustration.

Email Security/Spam Filters

You can think of these as a TSA checkpoint at an airport. Fun, right? They scan every email that comes through for potential threats, evaluates their risk, and either pulls them aside or sends them home.

Different factors in an email may raise red flags, and if enough red flags are raised the email may be allowed to pass through but is relegated to the spam folder. If there are excessive red flags or something that appears overtly malicious, the email will be rejected completely and never arrive.

Email providers have an aggregate record of IPs and Domains that consistently send problematic emails. It’s called a Sender Score, and can be thought of as a credit score for your email account. It’s managed by a company called Return Path. If you’re consistently having problems with rejected email or emails landing in spam, it would be worth checking yours at that link.

10 ways your email can look spammy

Make sure your emails don’t look like this:

  1. DON’T SHOUT IN ALL CAPS IN YOUR SUBJECT LINE!
  2. D o n t   p u t  g a p s  b e t w e e n  l e t t e r s  a n y w h e r e !
  3. One exclamation mark works fine, don’t go crazy!!!!!!!!!1!!!!!!
  4. Stay away from words and phrases that sound gimmicky: Buy Now, Click Here, Free, As Seen On, Double Your X, Money Making, Get Paid, Make Cash, Pre-Approved, Satisfaction Guaranteed, Low Price, Save Big, etc.
  5. Encourage subscribers to whitelist/add you as a contact, and personalize your ‘To’ field with the recipient’s name.
  6. Be sure your ‘From’ name is relevant to your business/site to prevent confusion.
  7. Keep images minimal. Having more space in the body of an email taken up by images than by text raises lots of red flags. Aim for a high text to image area ratio.
  8. Be very careful about the quality and quantity of links in the content. Keep the number of links minimized and don’t use url shorteners.
  9. Give a clear and obvious opt-out feature from future emails and follow through promptly.
  10. Reach out to inactive subscribers and keep your contact lists whittled down to those who want to hear from you. This can reduce the likelihood that folks that have lost interest will just mark you as spam to stop the emails because it’s faster than unsubscribing.

If you follow all these steps, you should see a sharp decline in your site’s failed email delivery

Like we said at the top, WordPress email can be a complex topic. It can be super complex and especially frustrating when things aren’t working and you have to dig into why. We’re calling this the Definitive Guide to WordPress Email, but it’s clear that we haven’t dug into every possible aspect of the subject. Heck, we haven’t even defined each technical term tossed around back in the beginning of the article. Why?

Because you don’t have to be an expert on WordPress or email to get to a place where email “just works”. You don’t have to understand what wrapping email data in PHP means, or be able to explain DNS settings. You just want your email to behave. You can do it, and hopefully this guide helps you get there!

0 Shares