Docs / Joomla

Send email in Joomla over SMTP

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.

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 Joomla

Go to System → Global Configuration → Server and scroll to Mail Settings:

FieldValue
Send MailYes
From Emailnoreply@your-domain.com — on your verified domain
From NameYour site name
MailerSMTP
SMTP Hostsmtp.postwing.app
SMTP Port587
SMTP SecuritySTARTTLS
SMTP AuthenticationYes
SMTP UsernameThe login of an SMTP token for your domain
SMTP PasswordThat token's password
STARTTLS goes with port 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:

configuration.php
<?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';

Send a test email

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.

Troubleshooting

ErrorCause 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 savingconfiguration.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.

Frequently asked questions

Where are Joomla's SMTP settings?

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.

Should Joomla's SMTP Security be SSL/TLS or STARTTLS?

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.

Why does Joomla say 'Could not instantiate mail function'?

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.

Why do Joomla emails go to spam?

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.

How do I test Joomla email?

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.

Why does the connection time out on my host?

Many shared hosts block outbound ports 25, 465 and 587. Set the SMTP Port to 8587 with STARTTLS, or 8465 with SSL/TLS.

Next steps