Docs / OpenCart

Send email in OpenCart over SMTP

OpenCart's default Mail engine uses PHP's mail() function, so on most hosting order confirmations are quietly discarded. Switching to SMTP takes one tab — with one quirk that catches almost everyone: OpenCart selects the encryption from a prefix on the hostname, not from a separate setting.

You can get them on the token management page. For security reasons, a token is shown only once — at the moment it is created.

SMTP connection settings

SettingValue
SMTP hostsmtp.postwing.app
Port587
EncryptionSTARTTLS (the connection is upgraded to TLS before login)
UsernameThe login of an SMTP token for your domain
PasswordThe password of that token — shown once, when the token is created
Every mode is also available on a high port: 8465 (SSL/TLS), 8587 (STARTTLS) and 8025 (plain). Many hosting providers and clouds block outbound 25, 465 and 587 — if the connection times out, switch to the matching high port.

Configure OpenCart

Go to System → Settings, edit your store and open the Mail tab:

FieldValue
Mail EngineSMTP
SMTP Hostnametls://smtp.postwing.app
SMTP UsernameThe login of an SMTP token for your domain
SMTP PasswordThat token's password
SMTP Port587
SMTP Timeout5
OpenCart has no encryption dropdown — it hands the hostname to PHP's stream layer, so the scheme decides the transport. Use tls://smtp.postwing.app with port 587, or ssl://smtp.postwing.app with port 465. A bare hostname opens an unencrypted connection and authentication is refused.

Set the store's sender address

On the Store tab of the same settings page, set E-Mail to an address on your verified domain. Leaving it as a personal Gmail or Yandex address means DKIM and SPF cannot align and receipts get filtered.

Choose which notifications go out

Further down the Mail tab, Alert Mail controls which events notify the store owner — new orders, account registrations, affiliate signups. Customer-facing order emails are governed separately by the order status settings under System → Localisation → Order Statuses.

Test the configuration

OpenCart has no built-in test button. Place a test order, or trigger a password reset from the customer login page — both go through the same mail engine. If nothing arrives, check System → Maintenance → Error Logs.

Troubleshooting

SymptomCause and fix
Error: SMTP connection failed Missing tls:// prefix, or a blocked port — try 8587.
Authentication refused Wrong credentials, or the connection is unencrypted because the prefix is absent.
Blank page when saving A suppressed PHP error — commonly the openssl extension is not enabled.
Connection closes immediately SMTP Timeout left empty. Set it to 5.
Owner gets mail, customer does not The order status has no customer notification enabled.
Mail goes to spam The store email is not on your verified domain.

Frequently asked questions

Where are OpenCart's SMTP settings?

System → Settings → edit your store → Mail tab. Set Mail Engine to SMTP and the hostname, username, password, port and timeout fields become relevant. OpenCart 3 and 4 use the same panel.

Why does OpenCart need tls:// in front of the SMTP hostname?

OpenCart has no separate encryption setting. It passes the hostname straight to PHP's stream functions, so the transport is selected by the scheme prefix: tls://host with port 587, or ssl://host with port 465. A bare hostname means an unencrypted connection, which the server will refuse.

Why are OpenCart order emails not sending?

First check that Mail Engine is set to SMTP rather than Mail — the default uses PHP's mail() function, which most hosting does not support. Then check the Mail Alert settings on the same tab: the order notification to the customer is separate from the one to the store owner.

What should the OpenCart SMTP timeout be?

Leave it at 5 seconds or raise it slightly. The field is often left blank, which makes the connection fail immediately on some PHP builds. It is not a delay — it is how long OpenCart waits for the server to respond.

Why do OpenCart emails go to spam?

The store email under System → Settings → Store tab must be on the domain you verified. Shops commonly leave it as a Gmail or Yandex address, which cannot align with your DKIM signature or SPF record, so DMARC fails.

Why does OpenCart show a blank page when saving mail settings?

Usually a PHP error suppressed by the display settings. Check the error log under System → Maintenance → Error Logs, and your PHP error log — most often it is a missing openssl extension, which SMTP over TLS requires.

Next steps