Skip to content
Paul Walsh

Website fixes · Guide

OpenCart Not Sending Order Emails: How to Fix It

By Paul Walsh Updated 7 min read

When OpenCart stops sending order emails, either the email was never sent, usually because the order never got a status and is sitting under "Missing Orders", or OpenCart sent it and it was blocked on the way because of the mail settings or your domain's email records. Work out which one it is first, then check the Mail tab under System, Settings.

The steps below work for OpenCart 3 and OpenCart 4. Where the two differ, I've said so.

First, work out whether OpenCart sent it at all

There are two different problems that look the same from the outside:

  1. OpenCart never sent the email. Something about the order or the settings meant it was never triggered.
  2. OpenCart sent it, but it never arrived. It left your store and was rejected, binned or sent to spam on the way.

Start with the order. Go to Sales, Orders and look for it. If it isn't in the list, change the Order Status filter to "Missing Orders". If it's there, the order never got a status, so OpenCart never sent the email, and the problem is the payment step (see below).

If the order is in the normal list with a status, OpenCart will have tried to send the confirmation. Check your spam folder, place a test order using a Gmail or Outlook address, and ask your host whether their mail logs show the message leaving the server. If it left but didn't arrive, the problem is delivery: the settings and domain records below.

Check the Mail tab

Go to System, Settings, then click the edit (pencil) button next to your store and open the Mail tab. While you're there, check the E-Mail field on the Store tab too: it's the address your order emails are sent from, and where your own order alerts go.

On the Mail tab you'll find:

  • Mail Engine: either "Mail" or "SMTP".
  • Mail Parameters: only used with "Mail".
  • SMTP Hostname, SMTP Username, SMTP Password, SMTP Port and SMTP Timeout in OpenCart 3. OpenCart 4 calls them Hostname, Username, Password, Port and Timeout.
  • Alert Mail and Additional Alert Mail, for your own order notifications.

"Mail" or "SMTP"?

Mail hands the email to your web server's own mail system. It's the default, and OpenCart's own help text says to choose it unless your host has switched off PHP's mail function. The catch is that email sent this way often isn't properly authenticated for your domain, so Gmail and Outlook treat it with suspicion.

SMTP makes OpenCart log in to a real mail server, such as your business email account or a transactional email service, and send through that. It takes a few more details to set up, but it's usually the more reliable choice, because the email comes from a server that's set up to send for your domain.

Using "Mail": the -f fix

If you stay on "Mail" and emails are going missing, a common cause is a mismatch between the address the email says it's from and the address the server sends it from behind the scenes, called the return path. Receiving mail servers notice, and the email fails their checks.

The fix is the Mail Parameters field. Enter -f followed by your store's email address, for example:

-f orders@yourshop.co.uk

That tells the server to use your store address as the return path, so the two match. OpenCart's own help text gives the same example. Use the same address as the E-Mail field on the Store tab.

Using SMTP: hostname, port and the ssl:// or tls:// prefix

Your email provider will give you a server name, a port, and a username and password. The part that trips people up is the hostname, because OpenCart uses a prefix on it to decide how to secure the connection. This works the same way in OpenCart 3 and 4:

  • ssl:// plus the server name, for example ssl://smtp.yourprovider.com: the connection is encrypted from the start. Providers usually pair this with port 465.
  • tls:// plus the server name, for example tls://smtp.yourprovider.com: OpenCart removes the prefix, connects, then switches to an encrypted connection with STARTTLS. Providers usually pair this with port 587.
  • No prefix: OpenCart connects without encryption, and many providers will refuse to let it log in.

Use whichever your provider tells you, and make sure the port matches the prefix. The username is usually your full email address. If you're sending through Gmail, OpenCart's help text notes you may need an app password rather than your normal one.

Customer emails only go at the first order status

This is the part most people don't expect. OpenCart sends the full order confirmation when an order gets its first status, moving from no status to "Pending", "Processing" or whatever your payment method sets. It doesn't send it again later.

After that, the customer only gets an email when you update the order and tick Notify Customer. That's in the order's history section (Add Order History in OpenCart 3, Add History in OpenCart 4). The "Customer Notified" column shows which updates were emailed. If you change statuses without ticking it, the customer hears nothing.

Orders stuck in "Missing Orders"

When a customer checks out, OpenCart saves the order with no status. The payment method is what gives it its first status, and that's the moment the confirmation and your alert are sent. If that never happens, the order stays without a status. It's left out of your normal order list, appears only under the "Missing Orders" filter, and no emails go.

Common reasons:

  • The payment provider's confirmation never reached your store, so a card or PayPal payment was taken but the order was never updated.
  • The payment extension is out of date or broken by a PHP upgrade.
  • The payment method's Order Status setting is blank or wrong. Each payment method has its own Order Status setting under Extensions, Extensions, Payments. Check the one you're using is set.

If customers have paid but their orders are missing, check your payment provider's account against the Missing Orders list first, so nobody's order is forgotten.

Alert emails for you, the shop owner

Your own "new order" email is controlled by Alert Mail on the Mail tab. Tick Orders to get one for every new order. It goes to the store's E-Mail address, plus any addresses in Additional Alert Mail, separated by commas.

Like the customer's email, it's only sent when the order gets its first status, so orders stuck in Missing Orders won't send you an alert either.

SPF, DKIM and DMARC on your domain

These are records on your domain that prove email really comes from you. The big email providers have tightened their rules, and email from a domain without them is far more likely to be binned. Whoever handles your email, your host or your mail service, will tell you exactly which records to add to your domain's DNS.

Send from an address on your own domain, such as orders@yourshop.co.uk, not a Gmail or Hotmail address. Email that claims to be from Gmail but comes from your web server fails these checks almost every time.

The same problem, and the same fix, applies on WordPress shops. If you also run a WooCommerce store, see WooCommerce not sending order emails and why WordPress isn't sending emails.

Quick checklist

  • Order found under Sales, Orders, not stuck in "Missing Orders"
  • Payment method's Order Status set under Extensions, Extensions, Payments
  • Store E-Mail on the Store tab is an address on your own domain
  • Mail Engine set to SMTP with your provider's details, or "Mail" with -f and your store address in Mail Parameters
  • SMTP hostname starts with ssl:// or tls://, with the matching port
  • Alert Mail has Orders ticked, and Additional Alert Mail lists anyone else who needs it
  • Notify Customer ticked when you update an order's status
  • SPF, DKIM and DMARC records on your domain
  • Test order placed and checked in Gmail and Outlook, including spam

If you've been through the list and emails still aren't arriving, or you'd rather not touch mail settings and DNS records yourself, it's a job I fix as part of OpenCart fixes, with the price agreed before I start.

About Paul Walsh

Developer based in Blackburn with 25+ years in electronics and tech. I've run online businesses of my own, and now build and fix websites for small businesses across the UK.

Related guides