WooCommerce email with Groundmail

Send WooCommerce order and account emails through Groundmail. WooCommerce sends mail with WordPress's wp_mail() function, so you connect an SMTP plugin to the Groundmail SMTP relay once and every WooCommerce email goes through it.


Prerequisites

  • A Groundmail account with a verified sending domain.
  • An SMTP credential: in the Groundmail dashboard, open SMTP and choose Create SMTP credential. The password (gmsmtp_…) is shown once, so copy it. See SMTP relay.
  • A WordPress site with WooCommerce and an SMTP plugin such as WP Mail SMTP or FluentSMTP.

Groundmail is for transactional mail: order confirmations, shipping updates, receipts and account emails. Don't use it for newsletters or promotional campaigns.


1. Connect the SMTP plugin

Follow the WordPress guide to set up WP Mail SMTP or FluentSMTP. The values are:

Setting Value
SMTP host smtp.groundmail.dev
Port 587
Encryption TLS (STARTTLS)
Authentication On
Username groundmail
Password Your SMTP credential (gmsmtp_…)

2. Match the WooCommerce sender

In WooCommerce, go to WooCommerce, then Settings, then Emails, and set the "From" address to an address on your verified domain, such as orders@yourdomain.com. WooCommerce's documentation recommends an address that matches your site's domain, and Groundmail requires it to be on a verified domain.

If your SMTP plugin has a Force From Email option, use the same address there so the two do not disagree.


3. Test it

First send a plugin test. In WP Mail SMTP, go to WP Mail SMTP, then Tools, open the Email Test tab and send to:

delivered@simulator.groundmail.dev

Then trigger a real WooCommerce email without emailing a customer. Create a test order in the WooCommerce admin with the billing email delivered@simulator.groundmail.dev, and change its status to Completed. If the customer's "Completed order" email is enabled under WooCommerce, Settings, Emails, WooCommerce sends it through your SMTP plugin.

Check the result in Groundmail: open Emails in the dashboard, or run:

curl "https://api.groundmail.dev/emails?limit=5" \
  -H "Authorization: Bearer $GROUNDMAIL_API_KEY"

The email appears with the status delivered and "test": true. Use bounce@simulator.groundmail.dev as the billing email to see a hard bounce. The full list is in Testing. Delete the test orders afterwards.


4. Watch delivery

SMTP gives the plugin only the hand-off result. To know whether an order email was delivered, bounced or marked as spam, create a webhook for email.delivered, email.bounced and email.complained, or look at the Emails page in the dashboard.


Troubleshooting

WooCommerce emails don't arrive but the plugin test works. Check the WooCommerce "From" address is on your verified domain. Also check the specific email is enabled under WooCommerce, Settings, Emails.

Authentication failed. The username must be exactly groundmail, and the password must be the SMTP credential (gmsmtp_…), not an API key (gm_…).

The message is rejected because of the From address. The domain must be a verified domain on your account. Until then you can only send from the sandbox sender, and only to your own account email.

A customer never gets an order email. The address may be on your suppression list, usually after a hard bounce. List suppressions with GET /suppressions (needs a full-access API key) and see Suppressions.

Connection errors. Check the host, port 587 and TLS encryption (not SSL). Some hosts block outgoing SMTP; ask yours to allow port 587.