OpenCart7 min read

OpenCart emails going to spam? Fix the mail engine first.

OpenCart ships with PHP mail() turned on by default. That path fails SPF, has no DKIM, and gets quarantined by Gmail and Outlook within hours. Here is the concrete fix list and a seed-test plan.

OpenCart is a popular open-source e-commerce platform, but out of the box it has one of the worst transactional email setups of any major cart. Order confirmations, password resets, and account emails all route through the web host's local sendmail binary via PHP's mail() function. That means they leave your shop with an envelope sender on the hosting provider's IP, no DKIM signature, and a SPF record that almost never includes the sending host. The result is a near-guaranteed trip to the spam folder, especially at Gmail and Outlook.

The short diagnosis

If OpenCart order emails never arrive or consistently land in Spam, the fix is almost always the same: switch the Mail Engine from Mail to SMTP, point it at an authenticated sender (Google Workspace, Zoho, SendGrid, Postmark, Brevo), and verify the From domain has SPF, DKIM, and DMARC set up for that provider.

Why OpenCart defaults are broken for deliverability

When you install OpenCart and leave the Mail Engine on its default value of Mail, every outbound email is handed to PHP's mail() function. PHP, in turn, passes the message to the local MTA on the web host (usually Postfix or Exim). From there the message is delivered directly from the shared hosting IP to the recipient.

There are four things wrong with this:

  • The SPF check fails. Your domain's SPF record almost certainly does not list the shared web host's IP. Gmail, Outlook, and Yahoo check SPF on the envelope sender and immediately flag the mail as unauthenticated.
  • There is no DKIM signature. The host's MTA signs for the host's domain, not yours. So DKIM either is absent or fails alignment checks.
  • DMARC alignment fails. With SPF broken and DKIM absent, any DMARC policy on your From domain rejects or quarantines the message.
  • Shared hosting IPs are pre-blacklisted. Budget hosts run thousands of sites on the same IP pool. One spammer neighbour is enough to drag your shop's emails to Spam.

Fix 1: Switch OpenCart to SMTP

The single most impactful change. In the OpenCart admin panel:

  1. Go to System → Settings and click Edit on your store.
  2. Open the Mail tab.
  3. Change Mail Engine from Mail to SMTP.
  4. Fill in SMTP Hostname, Username, Password, Port, and SMTP Timeout for your chosen provider.
  5. Set the Mail Protocol Prefix to tls:// if your provider requires TLS on port 587, or ssl:// on port 465. Leave blank for plain 25 (not recommended).

Typical SMTP values for popular providers:

Google Workspace (SMTP relay):
  Host:     smtp-relay.gmail.com
  Port:     587  (tls://)
  Username: your-workspace-user@yourdomain.com
  Password: App password (not the Google password)

SendGrid:
  Host:     smtp.sendgrid.net
  Port:     587  (tls://)
  Username: apikey
  Password: <your SendGrid API key>

Postmark:
  Host:     smtp.postmarkapp.com
  Port:     587  (tls://)
  Username: <server API token>
  Password: <server API token>

Brevo (ex-Sendinblue):
  Host:     smtp-relay.brevo.com
  Port:     587  (tls://)
  Username: your-brevo-login@brevo.com
  Password: <your SMTP key>

After saving, trigger a password reset or place a test order to yourself. Check the message source. If the Return-Path header shows the provider's domain and DKIM showsd=yourdomain.com, the engine swap worked.

Fix 2: Publish SPF, DKIM and DMARC for your From domain

SMTP alone does not fix deliverability. The From domain still has to authorise the SMTP provider. Each provider gives you a set of DNS records to add — usually one SPF include, two or three CNAMEs for DKIM, and a starter DMARC policy.

  • SPF: add the provider's include: clause. Example for SendGrid: v=spf1 include:sendgrid.net -all.
  • DKIM: publish the CNAMEs the provider hands you. They point to hosted keys managed by the provider. Do not copy-paste keys from tutorials — use the ones generated for your account.
  • DMARC: start with v=DMARC1; p=none; rua=mailto:you@yourdomain.com, watch aggregate reports for a week, then move to p=quarantine.
If you cannot install a SMTP module

Some shared hosts block outbound port 587. In that case you have two options: contact the host and ask them to open it, or use a provider that accepts API-based sending (Postmark, SendGrid, Mailgun) through a lightweight OpenCart extension instead of native SMTP.

Fix 3: Install a better OpenCart mail extension

OpenCart's built-in SMTP client is serviceable but limited. It does not queue failed messages, retry on soft bounce, or log sends. For higher-volume shops, a dedicated extension is worth the small one-time fee.

  • SMTP by Various — the most common free option on the OpenCart marketplace. Adds retry and better error logging on top of the default engine.
  • Mailgun / SendGrid API modules — bypass SMTP entirely and push through the provider's API. Faster on slow hosts and handles large attachments better.
  • AMP for Email extensions — if you want interactive order confirmations in Gmail, these add AMP-rendered templates on top of the existing mail pipeline.

Seed-test before going live

Once SMTP and DNS are in place, do not assume it works. Test. The easiest path:

  1. Create a test order using a throwaway cart product priced at zero or one cent.
  2. Put a dozen seed mailboxes (Gmail, Outlook, Yahoo, iCloud, ProtonMail, GMX, etc.) in the customer email field — one at a time or in a batch.
  3. Check where each one landed: Inbox, Promotions, Spam, or never arrived. A tool like this free inbox checker runs that entire grid in one test.
  4. Inspect the headers of a Gmail copy. Look for dkim=pass, spf=pass, and dmarc=pass all against your domain.

If any provider shows Spam placement, fix that specific provider before launching. Gmail is usually first to forgive; Outlook and Mail.ru are the slowest to rebuild trust.

Ongoing: warm the sending reputation

A shop that previously sent from a bad shared host has zero or negative reputation at the major mailbox providers. Moving to a clean SMTP provider is necessary but not instant. Expect two to three weeks of warming, during which you should:

  • Start with low volume: real orders only, no newsletters.
  • Keep content identical week-over-week so reputation signals stabilise.
  • Monitor DMARC aggregate reports — they are the fastest early warning for alignment drift.
  • Re-run a seed test weekly for the first month, then monthly afterwards.
OpenCart integration in beta

A native OpenCart integration is in private beta. It hooks into OpenCart's order-confirmation event, seed-tests a copy across 20+ mailbox providers, and alerts you in the admin panel if placement drops.

→ Join the beta waitlist

Frequently asked questions

Can I just use Gmail SMTP for my OpenCart shop?

Yes, for very low volume (under about 500 emails per day). Gmail SMTP has a 2,000/day hard limit and will throttle hard if you approach it. For a real shop use Google Workspace relay, SendGrid, or Postmark.

Do I need DKIM if I have SPF?

Yes. Gmail and Yahoo now require both SPF and DKIM to pass alignment for bulk senders. Most transactional providers set up DKIM for you with a few CNAMEs — there is no reason to skip it.

Why do my emails land in Promotions instead of Inbox at Gmail?

Promotions is not spam — Gmail just categorises commercial mail there. Order confirmations with authentication passing usually move to the primary inbox over time. If they stay in Promotions, review the template: fewer images and shorter marketing copy help.

How long until OpenCart delivery gets back to normal after the fix?

Expect 48 to 72 hours before Gmail recognises the authenticated sender, a week for Outlook, and up to two weeks for Yahoo and Mail.ru to rebuild reputation.

Related reading

Check your deliverability across 20+ providers

Gmail, Outlook, Yahoo, Mail.ru, Yandex, GMX, ProtonMail and more. Real inbox screenshots, SPF/DKIM/DMARC, spam engine verdicts. Free, no signup.

Run Free Test →

Unlimited tests · 20+ seed mailboxes · Live results · No account required