Blog

Troubleshoot WooCommerce not sending emails

Agathe Brusset Agathe Brusset
· 8 min read · Tips and resources · October 25th, 2023
WooCommerce not sending emails is a common issued faced by e-commerce business owners using the platform. By following the steps outlined in this article, you can troubleshoot the issue and ensure your emails land in the inbox.

When using WooCommerce, it’s possible for email deliverability to take a hit if your web host is not optimized for email sending. The last thing you want after a positive customer interaction is for the follow-up email to fail. Fortunately, the issue of WooCommerce emails not sending is preventable! First, let’s take a look at how WooCommerce emails are sent.

How emails are sent in WooCommerce

For starters, let’s address one important thing: Technically, WooCommerce and WordPress don’t actually send emails. As WooCommerce is an e-commerce plugin and WordPress is a content management system—neither of them are email servers—they call on the hosting provider’s mail server to do the work.

Here’s how it works:

  1. WooCommerce will call the wp_mail() function in WordPress.

  2. The WordPress mail function then passes the email to PHP, the scripting language behind WordPress.

  3. The PHP mail function finally instructs the mail server at the hosting provider to send the email.

How to fix WooCommerce not sending emails

There are a few reasons why your WooCommerce store emails are not being delivered. Here are the 4 most common issues and their solutions.

1. Check the status of orders

Sometimes the email is not sent because the transaction has not been completed. WooCommerce lists all your current orders on the Orders page. Orders with a Pending payment status means the customer either abandoned the payment page, had their credit card declined, or will pay manually through a bank transfer. 

Orders page

Sometimes orders are paid through payment gateways like PayPal yet they are still showing as pending payment. This is another common reason for WooCommerce not sending new order emails. Visit the PayPal troubleshooting page for more steps.

2. Verify your WooCommerce email settings

If your order has a Processing status and no emails have been sent yet, check if you accidentally disabled email sending in WooCommerce. It’s easy to do this.

Go to Settings under the WooCommerce menu, click on the Emails tab, and then select the Processing order template. Check that Enable this email notification is ticked. You can also set the Email type to plain text to test if HTML emails are being blocked.

Emails tab

3. Avoid email spam filters

Spam filters may be blocking your recipients from receiving emails. To check this, you can log all outgoing emails from WooCommerce by installing the WP Mail Logging plugin. Create a test order and go to WP Mail Log under the Tools menu. An email that is successfully sent will look like the example below, without any errors.

WP Mail Logging log

If the log shows the email was successfully sent but the recipient has not received it, check that you’re sending from your own domain. 

To do this, go to the WooCommerce Settings page, click on the Emails tab, and scroll down to Email sender options

Email sender options

The “From” address should be sent from your domain. For example, in the image above, the domain is lovelyscentedcandles.com. Using a Gmail or Yahoo email, like ovidia_candles@gmail.com, will go to the spam folder because the “From” email address does not match your sending domain.

SMTP error

If you see an exclamation mark in the Error column like the screenshot above, it indicates that there is an SMTP error returned by the receiving mail server. Click the View button and then click Raw to reveal the error message. Unfortunately, SMTP errors can be cryptic as they are handled differently between mail server configurations.

Raw message

4. Check for email template errors

If a specific email is not being sent while others continue to send normally, the issue resulting in WooCommerce not sending emails to customers could be down to a syntax error in the corresponding template. To check this, you can use the WP Mail Logging plugin and trigger a test email to see if the email is being generated and sent correctly. 

If there is a conflicting error in the template, it won’t be generated, as you’ll get an error in your logs indicating the error and which line it is located on. For example:

Line 46 syntax error, unexpected ‘ ‘ (T_STRING)

This could be caused by a theme overriding your templates. To test if this is the case, switch to the Storefront theme to see if this fixes the issue. If it does, then the problem causing WooCommerce to not send a particular email is your current theme. You can fix the issue by manually fixing the error in the theme, or by contacting the theme's creator.

5. Resolve conflicts between plugins

If the first 3 troubleshooting options don’t fix the problem, it might be a plugin issue. WordPress plugins can sometimes return errors before status changes happen. WooCommerce itself is a plugin for WordPress sites that can conflict with other plugins in your configuration.

To verify this, you will need to deactivate all of your plugins except for WooCommerce. Then reactivate them one by one to see if status changes are reflected in the Orders page. To assist you, install a plugin like WP debug log to identify “fatal errors” in the log.

Why an email service provider is the best path forward

Troubleshooting WooCommerce to improve deliverability will help, but it is not the best approach for a long-term fix. Ensure transactional emails reach your customers by incorporating an email service provider like MailerSend. You have two options of sending emails from WooCommerce with MailerSend: send quickly with an SMTP server or integrate an advanced email API with the official WooCommerce plugin.

Send WooCommerce emails using SMTP

SMTP (Simple Mail Transfer Protocol) is the fastest and easiest way to send emails from WooCommerce. A WordPress plugin directs the WordPress mail function to tell PHP to send email using an external SMTP server, so the email delivery is handled by an SMTP provider instead of your web host.

First, sign up with MailerSend if you don’t have an account yet. Add a sending domain and then retrieve your SMTP login details from the domain’s page. For optimal email deliverability and security, best practices are implemented such as using port 587 and TLS for the connection. Click on each field to copy it.

SMTP settings

Next, install the MailerSend - Official SMTP Integration plugin. Once installed, go to MailerSend SMTP on the Admin dashboard then paste your SMTP credentials from MailerSend.

With our WordPress plugin, all settings are natively integrated: you only have to put your username and password!

Remember to test your SMTP settings by going to the Send a test email section. Enter an address in the field and then click Send to check that emails are being sent using MailerSend’s SMTP server.

Congratulations! You just added SMTP sending to WooCommerce! 🎉 For more information about how to enable SMTP in MailerSend, visit the How to send emails via SMTP with MailerSend article.

Send emails with a dedicated WooCommerce plugin

Another way of sending emails from WooCommerce is to use MailerSend’s email API. An official plugin integrates MailerSend into WooCommerce and adds the ability to replace the standard templates with your own design as well as track email activity!

Get started by generating a new API token for your sending domain in MailerSend. Give it a name along with any custom access permissions. Remember to copy or download the API token that you created for the next step!

Create new API token

Next, download the official MailerSend plugin for WooCommerce. Once installed, you will see a new MailerSend menu item under WooCommerce. Copy the API token that you generated earlier, paste it in the API Token field, and click Validate token.

API token field

On the same page, scroll down to Email sending options and enter your sender name and sender address. The name and address entered here will be the default used for all of your emails in WooCommerce.

Email sending options

For best deliverability results, the sender address must match the domain that the API token belongs to. Using a different address will raise authentication issues with email providers and they are likely to filter your emails to spam.

Tempate gallery

Jumping to MailerSend, click on Templates and pick the email template that you wish to send when customers place a new order. When creating a template, you can either start from scratch or select a pre-designed template in the WooCommerce category where you’ll find all native WooCommerce email notifications.

These WooCommerce email templates have been designed to include all built-in variables like {{order.order_number}} or {{customer.first_name}}. Let’s pick the pre-designed Order processing template, for example, which we’ll customize to our store’s graphic identity. If you have a designer, you can design a custom template to match your brand!

Order confirmation template

The subject lines for all email templates will default to the following standard format:

[WordPress] (notification name) {{order.order_number}}

To customize them, go to the individual email template in MailerSend and enable Default settings. Then enter an example like this to match the subject line with your brand:

Your LovelyScentedCandles order #{{order.order_number}} is confirmed!

Order processing email template

Going back to your WooCommerce admin page, go to the MailerSend tab and paste the template ID in the Processing order field. You can find it on the email template page in MailerSend where you entered a custom subject line. 

Email notifications

To test sending an order email, click on the Save button to save changes and create a test order on the Order page. Return back to the MailerSend tab and click on the Test button next to the template. An email confirming receipt of the order should be sent! 🎉

From now on, your MailerSend templates will be triggered instead of the default WooCommerce templates. As a bonus, you can also track all email activity on the Activity page in your MailerSend account, a feature that is not possible using SMTP.

Activity page

For more information, including all the WooCommerce notifications and variables supported by the plugin, check out the detailed help article: How to integrate MailerSend with WooCommerce.

Take control of your e-commerce emails

WooCommerce is an incredible platform that powers millions of e-commerce stores, but it's not immune to email deliverability hiccups. You can ensure your online store delivers an amazing customer experience every time by using an email service provider like MailerSend. WooCommerce coupled with a proven email-sending infrastructure is your best bet for happy customers!

How are you currently sending emails from WooCommerce? Share in the comments below.

Agathe Brusset
I'm Agathe, Product Manager at MailerSend. When I'm not busy rolling out new product features, I'm planning my future mud-brick farmhouse complete with farm animals and a vineyard!