Joomla ships with SMTP support built in — no extension needed. Switching the mailer from PHP Mail to SMTP is one setting, and it fixes both halves of the usual problem: nothing listening on the local sendmail, and unauthenticated mail that fails SPF and DKIM at the recipient.
| Setting | Value |
|---|---|
| SMTP host | smtp.postwing.app |
| Port | 587 |
| Encryption | STARTTLS (the connection is upgraded to TLS before login) |
| Username | The login of an SMTP token for your domain |
| Password | The password of that token — shown once, when the token is created |
Go to System → Global Configuration → Server and scroll to Mail Settings:
| Field | Value |
|---|---|
| Send Mail | Yes |
| From Email | noreply@your-domain.com — on your verified domain |
| From Name | Your site name |
| Mailer | SMTP |
| SMTP Host | smtp.postwing.app |
| SMTP Port | 587 |
| SMTP Security | STARTTLS |
| SMTP Authentication | Yes |
| SMTP Username | The login of an SMTP token for your domain |
| SMTP Password | That token's password |
587; SSL/TLS goes with port 465. Any other combination fails the handshake, which Joomla reports as a generic connection error. The same settings, if you prefer editing the file directly:
<?php
// configuration.php — the same settings, if you prefer editing the file
public $mailer = 'smtp';
public $mailfrom = 'noreply@your-domain.com';
public $fromname = 'Acme';
public $sendmail = '/usr/sbin/sendmail';
public $smtpauth = '1';
public $smtpuser = 'token-login@your-domain.com';
public $smtppass = 'your-token-password';
public $smtphost = 'smtp.postwing.app';
public $smtpsecure = 'tls'; // 'tls' = STARTTLS, 'ssl' = implicit TLS
public $smtpport = '587';Still in Mail Settings, use Send Test Mail. On failure Joomla prints the SMTP server's own error, which tells you whether the problem is the port, the encryption or the credentials.
| Error | Cause and fix |
|---|---|
Could not instantiate mail function | Mailer is still set to PHP Mail. Switch it to SMTP. |
SMTP connect() failed | Blocked outbound port — use 8587 or 8465 — or the wrong security setting. |
SMTP Error: Could not authenticate | Wrong credentials, or SMTP Authentication set to No. |
| Settings revert after saving | configuration.php is not writable. |
| Test mail works, contact form does not | The contact form overrides the sender. Check the menu item's mail options. |
| Mail goes to spam | From Email is not on your verified domain. |
System → Global Configuration → Server tab → Mail Settings. Set Mailer to SMTP and the SMTP fields appear below it. The same values live in configuration.php in the site root if you would rather edit the file directly.
Joomla 4 and 5 label them separately: choose STARTTLS with port 587, or SSL/TLS with port 465. Older Joomla 3 offered 'tls' and 'ssl', which mean the same two things. Choosing the wrong pair is the usual reason the test email fails with a connection error.
That error comes from the PHP mail() mailer, not from SMTP — it means the Mailer setting is still on 'PHP Mail'. Switch it to SMTP. If it persists after switching, the settings were not saved, usually because configuration.php is not writable.
Check the From Email under Mail Settings. Joomla installs default to the address entered during installation, which is often on a different domain than the site. Set it to an address on the domain you verified so DKIM and SPF align.
Global Configuration's Mail Settings has a Send Test Mail button that sends to the configured From address and reports the SMTP error verbatim on failure. That message is far more useful than the generic warning users see on the front end.
Many shared hosts block outbound ports 25, 465 and 587. Set the SMTP Port to 8587 with STARTTLS, or 8465 with SSL/TLS.