E-commerce9 min read

Magento 2 transactional email: SMTP done right

Magento 2 and Adobe Commerce power stores that send millions of order confirmations a year. The default PHP mail path is a liability at that scale. Here is the transactional stack that actually holds.

Magento's mail layer is a thin wrapper over Symfony Mailer and Zend/Laminas Mail. By default, it hands the message tosendmail on the application server. At enterprise volume — a Magento 2 store doing 50k orders a month sends roughly 400k transactional emails across order, shipment, invoice, refund, and customer account flows — that is a recipe for silent delivery failure.

The fix is not exotic. Route outbound through an authenticated SMTP relay, sign with DKIM on a branded domain, and run seed tests after every template deploy. The specifics for Magento 2 are worth nailing because the ecosystem of SMTP modules varies in quality.

The enterprise stack

Mageplaza SMTP or the official Adobe Commerce SMTP extension plus SendGrid / Postmark / SES. Authenticate the domain, separate transactional from newsletter IP pools, keep the Klaviyo or Mailchimp stream on its own subdomain.

Why the default path fails

  • Local MTA: Adobe Commerce on self-hosted infrastructure almost always routes through Postfix or Sendmail on the web node. The web node's IP has no email reputation.
  • No DKIM: without Postfix-side OpenDKIM or an SMTP relay, transactional mail goes out unsigned. Gmail and Yahoo bulk-sender rules (since 2024) require DKIM for any volume above 5k/day.
  • Envelope leakage: the MAIL FROM ends up asnobody@webnode-prod-01.yourcorp.internal. DMARC alignment fails instantly once you publish a DMARC record.
  • Queue limitations: Magento's async email queue (on by default in 2.3+) reduces transaction timing pressure but does not add retry intelligence at the MTA level.

SMTP modules for Magento 2

Three options dominate. Pick one and stick with it — do not run two SMTP modules simultaneously, they will fight over the mailer transport.

  • Adobe Commerce native SMTP (Magento 2.4.6+): basic SMTP credentials in admin. Works. Minimal configuration, no per-transport routing.
  • Mageplaza SMTP: free and paid tiers. Handles API-based relays (SendGrid API, Mailgun API) in addition to plain SMTP. Provides a log. Our recommendation for most stores.
  • MagePal Transactional Email: splits transactional streams by template — send order confirmations via Postmark and customer account emails via SES. Useful for high-volume, high-complexity stores.

Example: Mageplaza SMTP with SendGrid API

# app/etc/env.php — credentials injected via deploy, not committed
return [
  'mageplaza_smtp' => [
    'enabled' => '1',
    'host' => 'smtp.sendgrid.net',
    'port' => '587',
    'username' => 'apikey',
    'password' => getenv('SENDGRID_API_KEY'),
    'protocol' => 'tls',
    'return_path_email' => 'bounce@yourstore.com',
  ],
];
Never commit env.php with secrets

app/etc/env.php is in .gitignore by default. Keep it that way. Inject credentials at deploy time via your CI runner or secrets manager — AWS Secrets Manager, HashiCorp Vault, or a simple env var chain in the web tier.

DNS: SPF, DKIM, DMARC

Authenticate the sender domain for the relay you chose. Below is SendGrid — each relay has an equivalent set.

; apex SPF — merge, do not duplicate
yourstore.com.              TXT   "v=spf1 include:sendgrid.net include:_spf.google.com -all"

; DKIM CNAMEs from SendGrid onboarding
s1._domainkey.yourstore.com CNAME s1.domainkey.u1234567.wl.sendgrid.net.
s2._domainkey.yourstore.com CNAME s2.domainkey.u1234567.wl.sendgrid.net.

; custom return-path (bounce) subdomain
em.yourstore.com            CNAME u1234567.wl.sendgrid.net.

; DMARC — tighten after 2-4 weeks of clean rua reports
_dmarc.yourstore.com        TXT   "v=DMARC1; p=quarantine; pct=25; rua=mailto:dmarc@yourstore.com; fo=1"

Subdomain strategy

For stores running more than one email stream (transactional + newsletter + abandoned cart + review requests), use subdomains to isolate reputation. A common layout:

  • orders.yourstore.com — Magento transactional via Postmark or SES.
  • news.yourstore.com — Klaviyo or Mailchimp campaigns.
  • support.yourstore.com — Zendesk / Gorgias replies.
  • Apex yourstore.com — Google Workspace only, never bulk.

Transactional templates

Adobe Commerce ships dozens of templates atapp/design/frontend/<theme>/email/. Review these specifically:

  1. order/new.html — the top revenue email. Strip upsell blocks, keep under 100 KB, verify plain-text alternative renders.
  2. shipment/new.html — often the second-most opened email. Include tracking link prominently, avoid image maps.
  3. invoice/new.html — PDFs attached as base64 blow up message size and hurt placement. Link to a hosted PDF instead.
  4. customer/account_new.html andcustomer/password_reset_confirmation.html — these land on first touch. A failure here loses the account before it starts.

Monitoring at scale

  • Postmaster Tools / SNDS: register the sender domain with Google Postmaster Tools and the sending IP range with Microsoft SNDS. Daily visibility.
  • DMARC aggregate reports: ingest the daily rua XMLs into a DMARC analyzer (dmarcian, Postmark's free analyzer, or a self-hosted parsr).
  • Seed testing on deploy: hook inbox-placement tests into your CI pipeline. Every template change should trigger a run across 20 providers.
  • Complaint rate: keep complaints under 0.1% on any stream. Magento exposes unsubscribe for newsletters but not for transactional — customers will mark as spam instead.
Seed-test Magento after every template deploy

Run an inbox placement test across 20+ mailboxes after each theme change. Catch layout regressions that push confirmations into Promotions before customers do.

→ Run Free Test · → Magento 2 integration beta

FAQ

Can Adobe Commerce Cloud handle transactional mail without an SMTP module?

Adobe Commerce Cloud proxies through an internal mail relay, but it still defaults to unsigned envelope paths for custom sender domains. You should still configure an SMTP module with DKIM on your domain.

Should order confirmations and newsletters share an IP?

No. Transactional and marketing streams have different engagement profiles. Mix them on one IP and a marketing unsubscribe complaint drags down your order confirmation reputation.

Does the Magento async email queue matter for deliverability?

Indirectly. It prevents checkout lag when the SMTP server is slow, so you are less tempted to drop messages. Turn it on. It does not affect authentication or placement.

How do I debug a specific customer who never got their confirmation?

Open the Mageplaza SMTP log for that order ID. If it shows accepted by the relay, pivot to the relay's activity log. If the relay shows delivered, the message landed in the recipient's provider — a seed test against that provider reveals whether it hit inbox, spam, or was silently dropped.
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