How to Send Emails in WooCommerce using WP Mail Plugin

On January 10, 2024
11min read
Ketevan Bostoganashvili Technical Content Writer @Mailtrap
Sending emails from WooCommerce

In 2024, WooCommerce had a market share of 36.68%, making it the leading e-commerce platform worldwide. Online stores use transactional emails to send notifications to their customers, such as receipts or order confirmations. So, WooCommerce also needs a working email-sending functionality. 

As a WordPress plugin, WooCommerce uses the native wp_mail()function to send emails, which is far from ideal. This means that emails addressed to your customers might not get sent or delivered to the inbox. They might even get discarded by the receiving mail servers.

In this tutorial, we’ll explain how to send emails in WooCommerce and land them in recipients’ inboxes. We’ll also talk about different types of transactional emails. Let’s dive right into it! 

Ready to deliver your emails?
Try Mailtrap for Free

Transactional emails in WooCommerce: definition, importance, examples

Transactional emails are emails that are triggered when a user takes a specific action. 

For example, when you forget your super difficult password (mydogmax111) for the 100th time and request a reset, you’ll receive an email with a password reset link. That would be a transactional email. 

Such emails are important as they provide users with necessary information about further steps, confirm their action, or let them know if something was unsuccessful. Refer to this article to learn more about WordPress transactional emails

By default, WooCommerce includes certain types of transactional emails that can be modified to match your needs. These are usually WooCommerce order emails: 

  • New order – sent to site administrators
  • Canceled order – sent to site administrators
  • Failed order – sent to site administrators
  • Order on hold – sent to customers 
  • Processing order – sent to customers
  • Completed order – sent to customers
  • Refunded order – sent to customers
  • Customer invoice / Order details – sent to customers
  • Customer note – sent to customers
  • Reset password – sent to customers
  • New account – sent to customers

These templates are available in plain text, HTML, or multipart formats. You can use them as they are or change their color or banner image. For that, you’d need to access WooCommerce email settings and scroll down to the ‘Email template’ section. 

Customizing WooCommerce email templates from the settings page

It’s also possible to change a particular template, for example, processing order. Simply press the ‘Manage’ button across the template. Fill in the empty fields, such as email subject, heading, additional content, and choose the email type (text, HTML, or multipart). Finally, hit ‘Save changes’. 

Customizing the content of the processing order template

If that’s not enough and you need more tweaks, just copy the template file below those fields by pressing ‘Copy file to theme’. 

Navigate to the ‘Appearance’ tab in the WordPress dashboard and choose ‘Theme file editor’. You’ll see the ‘Theme files’ tab on the right portion of the screen. Scroll down to find ‘WooCommerce’. Expand it and press ‘emails’ which will open the menu with the list of templates you copied. 

Choose the template you want to tweak and start coding. 

Note: it’s recommended to create a child theme and make changes there to avoid losing all the customizations in the parent theme. 

Customizing woocommerce email templates with code

WooCommerce’s default customization options are limited, but there are multiple plugins that can help with that (more on that below). You can also extend WooCommerce capabilities by using powerful form builders like JetFormBuilder for creating custom form and automating processes like email notifications.

Though plugins enable you to customize the design, you still have to come up with the content yourself or use templates. Here’s an order confirmation template from Mailtrap: 

Subject: Your [SERVICE] order confirmation

Your order is confirmed!

[NAME], thanks for shopping with us. Here are your order details:

[orderID]

[product + picture]

[quantity/other customizations]

[price_paid + payment method] // if payment by card, the last four digits should be used

[shipping + billing address]

We estimate that your order will arrive in 2-3 business days. Click the button below to track it.

TRACK YOUR ORDER

Forgot to add something? Here are the items our clients frequently buy together with [PRODUCT]. Get them within the next 24 hours, and we’ll ship everything together.

[FAQs]

Need any support? Send a reply to this message or contact us right away [link].

Thanks for your order and we hope you enjoy!

Attention: Mailtrap’s transactional email templates are almost ready and will be available to our users soon. 

Why use an SMTP plugin to send WooCommerce emails

As mentioned above, it’s possible to send emails programmatically from WooCommerce with the WordPress wp_mail() function. It calls PHP’s mail()function, which in turn connects with the local host to send emails. Check out this blog post to find more information about sending emails in WordPress

Without header authentication, PHP’s mail() function is often blocked by WordPress hosting providers. Email servers don’t tolerate this function either, putting incoming emails in the spam folder. 

But that’s not the only issue. WooCommerce emails might not be sent or delivered for other reasons as well (refer to the troubleshooting section below for more details). 

The Post SMTP plugin solves these problems by replacing the default PHP mail function and allowing you to route WooCommerce emails through an authenticated SMTP or API-based sending service.

It supports both major email providers like Gmail and third-party email delivery platforms, which makes it possible to send transactional emails from your WooCommerce store regardless of your hosting environment.

More information on setting up WordPress Gmail SMTP is available in another tutorial. 

How to send emails in WooCommerce with the Post SMTP plugin 

While Gmail integration is suitable for small e-commerce stores, you’ll need a dedicated SMTP or API-based sending service to handle higher volumes and ensure consistent delivery.

In this section, we’ll show you how to set up Post SMTP with Mailtrap to improve email performance in WooCommerce.

Mailtrap offers both a RESTful API and SMTP, combining fast delivery, strong inbox placement, and 24/7 technical support. Teams that use Mailtrap can rely on consistent email sending and access actionable analytics that track performance across major mailbox providers such as Office 365, Outlook, Gmail, and Google Workspace.

In addition to provider-level insights, Mailtrap includes detailed email logs that let you review sending history, message content, HTML and CSS rendering, spam score, and delivery status, making it easier to troubleshoot issues and fine-tune your WooCommerce email setup.

Step 1: Prepare Mailtrap for sending

Since Mailtrap will be sending emails on behalf of your store, the first step is to verify your domain.

So, log in to your Mailtrap dashboard and open the Sending Domains section. 

Then, add the domain you use for WooCommerce emails and copy the DNS records Mailtrap provides into your domain provider’s settings.

This is an image showing the Mailtrap domain setup page

These records enable authentication and let receiving servers know that Mailtrap is authorized to send emails for your domain.

Once the records are verified, complete the short business or personal details form required for compliance.

Next, go to Settings → API Tokens, create a new token, and assign the appropriate permissions. You’ll use this token to connect Mailtrap with Post SMTP.

This is an image showing the Mailtrap add API token page

Step 2: Install and configure Post SMTP in WordPress

Now switch to your WordPress dashboard and install the Post SMTP plugin from the Plugins section. After activation, launch the setup wizard.

When prompted to choose a mailer, select Mailtrap from the list of available integrations. 

This is an image showing the Post SMTP configuration step 1

Then enter:

  • From Email – an address that uses the domain you verified in Mailtrap
  • From Name – the name customers will see in their inbox
  • Mailtrap API token – the token you created earlier

Save the settings and continue through the wizard.

This is an image showing the Post SMTP configuration step 2

If your theme or other plugins modify sender details, enable the option that prevents them from overriding the From Email and From Name. This helps keep your sender identity consistent and reduces the risk of deliverability issues.

Step 3: Test WooCommerce email delivery

To confirm everything is working, use the test email feature inside Post SMTP and send a message to your own address. If the setup is correct, you’ll see a success notification, and the email will arrive shortly.

This is an image showing the Post SMTP email test success message

At this point, WooCommerce emails, such as order confirmations, password resets, and customer notifications, will be sent through Mailtrap instead of the default PHP mail function.

That means your store now benefits from authenticated sending, better inbox placement, and access to delivery logs and diagnostics whenever you need to troubleshoot.

How to send emails in WooCommerce with the WP Mail SMTP plugin

WP Mail SMTP makes it possible to route WooCommerce emails through an external SMTP service, but since it doesn’t include a native integration with Mailtrap, the connection has to be configured manually.

To get started, create a Mailtrap account and verify your sending domain. This step enables authentication and ensures that Mailtrap is authorized to send emails on behalf of your store. 

This is an image showing the Mailtrap domain setup page

Once your domain is verified, open the Sending Domains section in Mailtrap, select your domain, and go to the Integration tab.

This is an image showing the Mailtrap sending domains page

Here, choose the Transactional or Bulk stream depending on the type of emails you plan to send, and copy the SMTP credentials provided.

Next, return to your WordPress dashboard and install the WP Mail SMTP plugin. 

This is an image showing the WP Mail SMTP plugin

After activation, open the plugin settings.

Under the General tab, enter:

  • From Name – the name customers will see in their inbox
  • From Email – an address that uses your verified domain

Remember: If you can’t configure From Email and From Name, make sure to come back to this step after connecting the mailer. 

This is an image showing WP Mail SMTP plugin settings

To ensure your WooCommerce emails don’t go to the spam folder, it’s also recommended to turn on the ‘Force From Email’ option shown in the image above. That way, all emails will be sent from the email address that represents your store. 

However, if you want to have different addresses for confirmation emails and password resets, for example, keep this option off (you’ll learn how to do that here).

Next, scroll down to the Mailer section and select Other SMTP. 

Since Mailtrap isn’t listed as a built-in provider, this is where you manually enter your Mailtrap SMTP details:

  • SMTP Host: live.smtp.mailtrap.io (transactional) or bulk.smtp.mailtrap.io (bulk)
  • Encryption: SSL or TLS (TLS is recommended)
  • SMTP Port: 587 (TLS) or 465 (SSL)
  • SMTP Authentication: On
  • SMTP Username: api
  • SMTP Password: the password from your Mailtrap account
This is an image showing WP Mail SMTP plugin settings second part

To complete the configuration, save the settings.

And to make sure everything is working correctly, open the Email Test tab in WP Mail SMTP, enter your email address, and send a test message.

This is an image showing WP Mail SMTP plugin test email option

If the email arrives successfully, WooCommerce is now set up to send transactional emails through Mailtrap instead of relying on the default PHP mail function.

Sending emails with attachments 

Store owners don’t really need attachments on a day-to-day basis. Order confirmation or welcome emails to new customers don’t necessarily contain any images or files. 

Yet there are times when you might need attachments. For example, if you have a corporate client, they might request a custom invoice. You can’t include that in the default ‘customer invoice/order details’ email. 

It’s possible to add attachments with slight modifications to the PHP code. 

Go to the WordPress dashboard and press ‘Media’ > ‘Add New’ to select the necessary files. Navigate to the functions.php file of your child theme and insert the following snippet at the bottom: 

add_filter( 'woocommerce_email_attachments', 'attach_to_woo_emails', 10, 3);
function attach_to_woo_emails ( $attachments , $email_id, $order ) {

	// Avoiding errors and problems
    if ( ! is_a( $order, 'WC_Order' ) || ! isset( $email_id ) ) {
        return $attachments;
    }
	
	$file_path = get_template_directory() . '/invoice1.pdf'; // directory of the current theme

 	// if you are using a child theme, use this line instead to get the directory
 	// $file_path = get_stylesheet_directory() . '/invoice1.pdf';

	$attachments[] = $file_path;
	return $attachments;
}

Alternatively, you could use WooCommerce plugins such as WooCommerce PDF Invoices & Packing Slips or Email Attachments

Sending custom emails

You’ll have to send custom emails if you want to send after-purchase emails from WooCommerce. 

Surprisingly enough, you can’t send email after order to your customers by default. The new order, canceled order, and failed order are all addressed to site administrators. 

The native way of sending custom emails is a bit complicated. You’ll need to create an email manager class, extend WC_Email classes, and then build a custom template in plain text and HTML formats. That way, you’ll be able to send HTML email when it’s supported. If not, the email will be displayed in plain text format.

When the custom order emails are created, they will appear in Woocommerce settings. 

So, if you want to create a custom email, we recommend checking out this guide

You can also use ready-made WooCommerce templates and modify them. 

If you prefer to use a plugin, you’ll need a premium Follow-Ups plugin. It will help you notify your customers when you’re updating orders (or any other event) or send emails to vendors directly from WooCommerce. 

You’ll find information on installing and using this plugin here

What other plugins can you use to customize and send emails in WooCommerce?

YayMail Email Customizer is one of the many plugins that can help with email customization, while WooLentor customizer plugin allows designing your own email template. But if you’re looking to explore other tools, here are a few more plugin options to consider.

FluentSMTP – WordPress SMTP Plugin

FluentSMTP helps WooCommerce stores send transactional emails, such as order confirmations, refunds, and password resets, through authenticated SMTP or API-based providers instead of relying on the default PHP mail setup. This makes email delivery more reliable, especially for stores that process a high volume of orders.

The plugin supports multiple email connections, detailed email logs, and resend options directly from the WordPress dashboard, so store owners can track which WooCommerce emails were sent successfully and quickly troubleshoot failed deliveries. It also includes built-in testing tools to verify that your store’s email configuration is working as expected before sending messages to customers.

YayMail – WooCommerce Email Customizer

YayMail WooCommerce Email Customizer is a WordPress plugin that allows you to customize email content and design. 

With this plugin, you can easily edit the layout of default WooCommerce templates by customizing the colors, fonts, and images, and adding custom fields. These could be the customer’s first name or the order total. The plugin comes with shortcodes that can be used to create dynamic content such as customers’ order history, a list of related products, or coupon codes. 

YayMail has a drag-and-drop menu for easy editing. 

WooCommerce Multiple Email Recipients

WooCommerce Multiple Email Recipients lets you send emails to multiple addresses with ease. Route admin notifications to your team, suppliers, or dropshippers based on products ordered, and send customer emails to extra recipients, including third-party plugin notifications.

Additional email fields can appear on checkout or account pages. With a quick 5-minute setup, you can install the plugin, configure settings, and start adding extra email addresses to streamline communication and order management.

WooCommerce not sending emails: troubleshooting the most common issues

Even though a good WordPress plugin solves most of the sending problems, it’s not almighty. WooCommerce might still not send emails because of its quirks. Below we’ll list down common ways to fix WooCommerce sending issues.  

Checking the order status 

Pending orders are a common cause of not receiving emails. These are abandoned cart orders, i.e. users didn’t proceed with payment and left the checkout page. Pending orders are considered to be incomplete orders, which is why they don’t trigger emails. 

If you receive payment via Paypal and the status of the payment is ‘Pending Payment’, it could indicate a problem with your payment gateway setup. In that case, you should contact WooCommerce support. 

If you don’t have pending orders and all the order statuses are in check, you might be facing plugin incompatibility. The solution is to disable all the plugins except for WooCommerce and see if the issue gets resolved. 

Checking the email notification settings 

Normally, when orders update from pending to processing, you should receive an email along with your customers. If you’re not receiving emails, it could be because the ‘Enable this email notification’ is toggled off. 

Go to the ‘Emails’ tab in your WooCommerce settings and make sure this checkbox is marked for every template. 

Checking whether the emails were sent and not received 

If all the above steps check out but the emails are still not getting sent, the issue might be with From address and name. If you’re not using an SMTP plugin, go to the email settings of your WooCommerce store, scroll down to the ‘Email Sender options’ tab, and make sure you’re using an email address with your domain in it (example@your.domain). 

Your emails might still end up in the spam folder even with the correct from name. The culprit will be the PHP mail() function. 

Checkin email sender options in WooCommerce

If you’re using an SMTP plugin, go to its settings and make sure From Email is configured properly. Now you should be able to send emails from WooCommerce successfully. 

Wrapping up

WooCommerce email delivery doesn’t have to be complicated – but it does need the right setup. The default way WordPress sends emails works only up to a point, and once your store starts handling real orders and real customers, reliability becomes critical. 

Using an SMTP plugin and a proper email-sending service takes the guesswork out of the process and helps make sure that order confirmations, password resets, and customer notifications actually reach the inbox. With that in place, you can focus on running your store instead of troubleshooting missing emails.

FAQ

Do I need a verified sending domain to send WooCommerce emails?

You can send emails without it, but deliverability will suffer. Verifying your domain with SPF and DKIM helps email providers trust your messages and keeps WooCommerce emails out of spam folders. For example, Mailtrap provides automatic email authentication and DNS setup.

Can I use a different “From” name or email address for WooCommerce emails without hurting deliverability?

Yes, as long as the email address belongs to your verified domain. Changing the name is fine, but using a different domain in the From address can trigger spam filters.

Why does WooCommerce show “Email has been sent” but customers never receive it?

Because WooCommerce only confirms that the email was handed off, not delivered. If you’re using the default PHP mail setup, the message may be blocked or dropped before it reaches the inbox. Using SMTP usually fixes this.

Can I send WooCommerce emails from a free email domain (Gmail, Yahoo, Outlook)?

You can, but it’s not recommended for stores. Free domains often fail authentication checks, which increases the risk of emails landing in spam. A domain-based address (like orders@yourstore.com) is much more reliable.

Article by Ketevan Bostoganashvili Technical Content Writer @Mailtrap

I’m a Technical Content Writer with more than 5 years of experience and passion to cover software engineering topics. I mostly write about email infrastructure and create code-rich guides about sending and testing emails, but I also love writing about result-driven email marketing.