Joomla

How to Configure SMTP in Joomla: Step-by-Step Guide for Reliable Delivery

Ziaul Kabir
••5 min read
How to Configure SMTP in Joomla: Step-by-Step Guide for Reliable Delivery

How to Set Up SMTP in Joomla 4 and 5 (Gmail, SendGrid & Your Host)

Quick answer: In Joomla, go to System > Global Configuration > Server, scroll to the Mail section, and change Mailer to SMTP. Then enter your SMTP host, port, security type, username, and password, save, and click Send Test Mail.

SMTP (Simple Mail Transfer Protocol) lets your Joomla site send email through an authenticated mail server instead of the default PHP mail function. If your contact forms, password resets, or user registration emails aren't arriving, or they land in spam, switching to SMTP is usually the fix. This guide covers Joomla 4.x and 5.x.

What You Need Before You Start

  • Super User access to your Joomla administrator panel
  • An SMTP account from your hosting provider, Gmail, SendGrid, or another email service
  • The SMTP host, port, username, and password for that account

Common SMTP Settings at a Glance

ProviderHostPort / SecurityUsernamePassword
Gmailsmtp.gmail.com465 (SSL) or 587 (TLS/STARTTLS)Your full Gmail addressApp password
SendGridsmtp.sendgrid.net465 (SSL) or 587 (TLS/STARTTLS)apikey (literally)Your SendGrid API key
Hosting providerCheck your host's docs (often mail.yourdomain.com)Usually 465 or 587Your full email addressYour email password

Step 1: Open the Mail Settings in Global Configuration

  1. Log in at yoursite.com/administrator.
  2. In the left menu, click System, then click Global Configuration under the Setup section.
  3. Open the Server tab and scroll down to the Mail section.

Step 2: Switch the Mailer to SMTP

  1. Make sure Send Mail is set to Yes.
  2. Change Mailer from PHP Mail to SMTP.
  3. Set From Email to an address on the same domain as your SMTP account (for example, info@yourdomain.com), and set From Name to your site or brand name.

Using a From address that doesn't match your authenticated account is one of the most common reasons emails get rejected or marked as spam.

Step 3: Enter Your SMTP Server Details

  1. SMTP Authentication: set to Yes.
  2. SMTP Security: choose the option that matches your port. Use SSL (or SSL/TLS) with port 465, and TLS (or STARTTLS) with port 587. Labels vary slightly between Joomla versions.
  3. SMTP Port: enter 465 or 587 to match the security setting above.
  4. SMTP Username: enter the username for your mail account (see the table above).
  5. SMTP Password: enter the account password or API key.
  6. SMTP Host: enter the server address, such as smtp.gmail.com.

Gmail notes

Google no longer accepts your regular account password for SMTP in most cases. Turn on 2-Step Verification, then create an app password and use it as your SMTP password. Gmail also limits daily sending, so it works for small sites but isn't ideal for newsletters or high-traffic stores.

SendGrid notes

Set the username to the exact word apikey and paste your API key as the password. Verify your sender address or domain inside SendGrid first, or messages will be rejected. SendGrid's free-plan availability has changed over time, so check their current pricing.

Step 4: Save and Send a Test Email

  1. Click Save at the top of the page.
  2. Return to the Server tab, scroll to the Mail section, and click Send Test Mail.
  3. Check the inbox of the From Email address (and the spam folder) for the test message.

A success message in Joomla means the site connected to your SMTP server. Test with a real form or password reset too.

Improve Email Deliverability

Getting SMTP to connect is only half the job. To keep emails out of spam:

  • Add SPF and DKIM records for your domain in your DNS settings. Your email provider will give you the exact values.
  • Add a DMARC record to protect your domain from spoofing and improve trust with Gmail and Outlook.
  • Match the From Email to your authenticated domain.
  • Use a transactional email service (such as SendGrid, Brevo, Mailgun, or Amazon SES) for higher volumes instead of a personal mailbox.

Troubleshooting Common Joomla SMTP Errors

  • "Could not instantiate mail function": the Mailer is still set to PHP Mail, or the host blocks it. Switch to SMTP and re-test.
  • "SMTP Error: Could not authenticate": the username or password is wrong. For Gmail, make sure you're using an app password; for SendGrid, make sure the username is apikey.
  • "SMTP connect() failed": check the host, port, and security type. If those are correct, your server's firewall may be blocking outbound SMTP ports. Ask your host to open port 465 or 587.
  • Test mail works but emails go to spam: set up SPF, DKIM, and DMARC, and confirm the From Email matches your domain.
  • Emails stop after a certain number: you may have hit your provider's daily sending limit.

Frequently Asked Questions

Which SMTP port should I use in Joomla?

Use port 587 with TLS/STARTTLS or port 465 with SSL. Both work with most providers. Avoid port 25, since many hosts block it.

Why are my Joomla emails going to spam?

Usually because the domain has no SPF/DKIM records, or the From Email doesn't match the account used to send. Fix both and re-test.

Can I use my hosting provider's SMTP instead of Gmail?

Yes, and it's often the easiest option. Create an email account in your hosting control panel and use the mail server details your host provides.

Do I need SMTP if PHP Mail already works?

Not strictly, but SMTP is more reliable and gives you authentication, which improves inbox placement.

Conclusion

Setting up SMTP in Joomla takes only a few minutes and makes your site's emails far more reliable. Choose a provider, enter the correct host, port, and credentials, send a test message, and add SPF, DKIM, and DMARC records so your emails reach the inbox. For more detail on mail settings, see the official Joomla documentation.

Written by

Ziaul Kabir

Share:

Comments (0)

No comments yet. Be the first to comment!