Applies to Joomla 6.2 · Gmail · Microsoft 365 · Brevo Checked 24 Nov 2026

Joomla SMTP settings live in System » Global Configuration » Server » Mail: set Mailer to SMTP, then enter your provider's host, port, security and login. Here are the values for Gmail, Microsoft 365 and Brevo, what each field means in Joomla 6.2, and the error messages you'll see when one of them is wrong.

The values, provider by provider

ProviderSMTP HostPortSecurityAuthentication
Gmail (app password)smtp.gmail.com587TLSUsername and Password (app password)
Gmail or Google Workspace (OAuth)smtp.gmail.com587TLSOAuth 2.0
Microsoft 365smtp.office365.com587TLSOAuth 2.0
Brevosmtp-relay.brevo.com587TLSUsername and Password (SMTP key)

The username is the Gmail or Microsoft 365 address you send from, or for Brevo the SMTP login shown in your Brevo account. Set From Email to an address the provider lets you send as: the Gmail or Microsoft 365 mailbox you log in with, or a sender you verified in Brevo. A From address the provider doesn't accept is the most common reason a correct login still fails.

The Mail panel in Joomla 6.2, field by field

  • Send Mail – No switches off all mail from the site. It has to be Yes.
  • From Email, From Name, Reply To Email – the sender every core email uses.
  • Mailer – PHP Mail (the default), Sendmail or SMTP. PHP Mail hands the message to the web server, which many hosts limit and many inboxes distrust. SMTP logs in to a real mail account.
  • SMTP Host and SMTP Port – from the table above. The defaults are localhost and 25.
  • SMTP Security – None, SSL or TLS. In Joomla, TLS means STARTTLS: the connection starts plain on port 587 and is upgraded. SSL is encrypted from the first byte, on port 465. With None, Joomla's mailer (PHPMailer) still tries STARTTLS when the server offers it, but if that send fails it retries without encryption – so for an outside provider pick TLS or SSL, not None.
  • SMTP Authentication – Disabled, Username and Password, or OAuth 2.0. The OAuth option is new in Joomla 6.2 and adds the Client ID, Client Secret, Scope, Authorize URL and Token URL fields.

Everything ends up in configuration.php. For Microsoft 365 with OAuth it looks like this (the token fields are filled in by Joomla, not by you):

// configuration.php (excerpt)
public $mailonline = true;
public $mailer = 'smtp';
public $mailfrom = 'web@example.com';
public $fromname = 'Example Site';
public $smtphost = 'smtp.office365.com';
public $smtpport = 587;
public $smtpsecure = 'tls';
public $smtpauth = '2';   // 0 = Disabled, 1 = Username and Password, 2 = OAuth 2.0
public $smtpuser = 'web@example.com';
public $smtp_oauth2_scope = 'https://outlook.office.com/SMTP.Send offline_access';

Gmail: app password or OAuth

App password (the quick way)

  1. Turn on 2-Step Verification for the Google account. App passwords only work with it on.
  2. Create an app password in the Google account's security settings and copy the 16 characters.
  3. In Joomla: host smtp.gmail.com, port 587, security TLS (or port 465 with SSL), authentication Username and Password, username = the full Gmail address, password = the app password.

Google revokes app passwords when the account password changes, and work or school accounts often can't create them at all. Google Workspace stopped accepting the normal account password from apps on 1 May 2025, so for Workspace the choice is an app password where the admin allows it, or OAuth.

OAuth 2.0 (Joomla 6.2)

  1. In Google Cloud Console, create a project, set up the OAuth consent screen and create an OAuth client of type Web application.
  2. Add the authorized redirect URI. Copy it from Joomla: choose OAuth 2.0 under SMTP Authentication and the OAuth2 Information note shows the callback URL for your site. It looks like https://www.example.com/administrator/index.php?option=com_config&task=mail.oauth2callback&format=raw, and it must match exactly – https vs http, www or not, subfolder included. Open the administrator at that same address when you get the token.
  3. In Joomla: host smtp.gmail.com, port 587, security TLS, authentication OAuth 2.0, username = the Gmail address. Then the Client ID and Client Secret, scope https://mail.google.com/, Authorize URL https://accounts.google.com/o/oauth2/v2/auth, Token URL https://oauth2.googleapis.com/token.
  4. Save, then click Get OAuth2 Token, sign in with the sending account and allow access. Back in Joomla, Validate Token shows whether it works.

One trap: an OAuth app with an External audience that is still in Testing only lets in the accounts you add as test users, and it gets refresh tokens that expire after 7 days – so mail stops a week later. On Google Workspace, set the audience to Internal. For a personal Gmail account, either publish the app to production (Google then shows an "unverified app" warning you click through for your own account) or use an app password. Changing the Google account password also revokes the token: click Reissue OAuth2 Token afterwards.

Gmail is fine for contact forms and password resets, not for newsletters: even Google Workspace stops at 2,000 messages per user per day.

Microsoft 365: switch to OAuth before the end of December

Microsoft has been retiring Basic authentication (username and password) for SMTP AUTH in Exchange Online. As of its January 2026 update, Basic authentication will be disabled by default for existing tenants at the end of December 2026. Admins can still turn it back on for now, and Microsoft plans to announce the final removal date in the second half of 2027. When it's off, a username-and-password login fails: Joomla shows "SMTP Error! Could not authenticate.", and with mail logging on, the log shows Microsoft's answer 550 5.7.30 Basic authentication is not supported for Client Submission.

Joomla 6.2's OAuth 2.0 option is the way around it:

  1. In the Microsoft 365 admin center, open the mailbox (Users » Active users » the user » Mail » Manage email apps) and tick Authenticated SMTP. If the tenant uses security defaults, SMTP AUTH is off for everyone and this setting does nothing until an admin turns security defaults off.
  2. In Microsoft Entra, register an application (App registrations » New registration, single tenant) and note the Application (client) ID and Directory (tenant) ID.
  3. Under Authentication, add a Web platform with the callback URL from Joomla's OAuth2 Information note, exactly as shown there.
  4. Under API permissions, add the delegated SMTP.Send permission (Microsoft Graph) and grant admin consent – without it, signing in stops at "Need admin approval". Then create a client secret and copy its Value – not the Secret ID.
  5. In Joomla: host smtp.office365.com, port 587, security TLS, OAuth 2.0, username = the mailbox address, scope https://outlook.office.com/SMTP.Send offline_access, Authorize URL https://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/authorize, Token URL https://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/token.
  6. Save, Get OAuth2 Token, sign in as the mailbox, then Validate Token.

Port 465 doesn't work with Microsoft 365 – use 587. Keep From Email the same as the mailbox; another address needs "Send As" rights on it. Changes in Entra or Exchange can take up to about an hour to apply, so a failure right after setup is worth retrying later. The limits are 10,000 recipients per day and 30 messages per minute. The Joomla OAuth 2.0 guide has screenshots of the Entra steps.

Brevo: SMTP login and SMTP key

  1. In Brevo, authenticate your domain and create the sender you'll use as From Email.
  2. Open Brevo's SMTP page. The SMTP login shown there is your username – on newer accounts it looks like 123456789@smtp-brevo.com, not your Brevo login email.
  3. Generate an SMTP key on the same page. An API key won't work as the password.
  4. In Joomla: host smtp-relay.brevo.com, port 587, security TLS, authentication Username and Password, username = the SMTP login, password = the SMTP key.

Brevo's guide says to leave encryption empty on 587 and choose SSL on 465. In Joomla, TLS on 587 is the safer choice: it requires STARTTLS, while None lets the mailer retry without encryption. If your host blocks 587, Brevo also listens on 2525.

Send the test mail – and read the result

The Send Test Mail button under the Mail panel uses the values in the form, so you can test before saving. A few things that surprise people:

  • The test goes to your own user account's email, not to the From address.
  • OAuth is the exception: Joomla reads the OAuth settings from the saved configuration, so save first, then get the token, then test.
  • A yellow "sent … using SMTP as fallback" message on a first setup is harmless: Joomla compares the mailer it used with the saved Mailer, which is still PHP Mail until you save. Save, then test again.
  • A green message means the provider accepted the mail – not that it reached the inbox. Check the spam folder too.

Errors and what they usually mean

You seeUsually
SMTP Error! Could not connect to SMTP host.Wrong host or port, or the hosting company blocks outgoing SMTP. Try the other port (587 / 465, Brevo also 2525) or ask the host.
SMTP Error! Could not authenticate.Wrong username or password: the normal Google password instead of an app password, an API key instead of a Brevo SMTP key, or SMTP AUTH turned off for the Microsoft 365 mailbox. On Microsoft 365 with Basic authentication disabled (the mail log shows 550 5.7.30), switch to OAuth 2.0.
Token is invalid or refresh failed.The refresh token expired or was revoked (Google app in Testing, client secret expired in Entra). Click Reissue OAuth2 Token.
The test works, real mail lands in spamThe domain's SPF, DKIM or DMARC records don't cover the provider. Add the records the provider gives you at your DNS host.

Still stuck? Turn on Debug System, log the mail category and send a test – our FAQ Emails from my site don't arrive shows the steps, and Password reset emails never arrive covers the most common complaint.

When the core settings aren't enough

Core SMTP sends the mail, but it keeps no record of what was sent, can't use an email API when the host blocks SMTP ports, and leaves the OAuth endpoints to you. PX Mail, our free extension for Joomla 6, adds SMTP presets, Gmail OAuth without typing endpoints (for Microsoft 365 OAuth, use core 6.2 as above), HTTPS email APIs (Brevo, Mailgun, Postmark and others), a 7-day email log and an SPF, DKIM and DMARC check. Core SMTP vs PX Mail compares the two, and if you'd rather not touch mail settings at all, our Joomla maintenance plans cover it.