How to fix Joomla ‘SMTP connect() failed’ error while sending mails

How to fix Joomla ‘SMTP connect() failed’ error while sending mails

Joomla is a commonly used content-management software for websites. In Joomla, emails are used for various purposes such as contact form submissions or password resets.

Joomla ‘SMTP connect() failed‘ is a commonly encountered email error in Joomla, when users try to submit a contact form in the website. Email fails to send, showing up this error.

By default, Joomla uses the PHP mail function to send mails. The settings for PHP Mail can be changed from the Joomla administrator dashboard.

Login to Joomla as admin user and go to the section ‘System’ -> ‘Global Configuration’ -> ‘Server’. Under ‘Mail Settings’, you can see PHP Mail as the Mailer and its corresponding settings.

 

Default setting in Joomla - PHP mail function

Default setting in Joomla – PHP mail function

 

What causes error Joomla ‘SMTP connect() failed’

In many servers where PHP mail function is disabled as a server security measure to avoid spamming, this default Mailer will not work to send mails.

That’s when we configure SMTP as the Mailer. From the drop-down for Mailer, choose SMTP instead of PHP Mail:

 

Change PHP mail to SMTP mail function

Change PHP mail to SMTP mail

 

Even though SMTP mailer is chosen, if the corresponding settings for the SMTP server is not configured correctly, it will not send mails successfully from the server.

Attempts to send mails from the Joomla website via contact form or password reset forms would end up giving error “Error while sending the email. SMTP connect() failed.”

The error ‘Joomla SMTP connect() failed’ is often caused by incorrect filling of the field ‘SMTP Security’ in the ‘Mail Settings’.

SMTP connection can fail to establish due to a number of reasons:

  1. Wrong username and password given in SMTP authentication.
  2. SMTP port blocked in server firewalls.
  3. Mail server does not support SSL/TLS.
  4. Using 3rd party servers such as gmail or other insecure apps.
  5. Upgrades to Joomla or PHPMailer versions that have enhanced security features or bugs.

How to fix error Joomla ‘SMTP connect() failed’

Here, we’ll see how to set each of these settings properly to avoid email delivery errors from Joomla. 

In Joomla administrator panel, under ‘System’ -> ‘Global Configuration’ -> ‘Server’ -> ‘Mail Settings’, choose Mailer ‘SMTP’ and enter host, user name and password. Turn on SMTP authentication section.

 

SMTP configuration settings for Joomla mail

SMTP configuration settings for Joomla mail

1. SMTP host and port settings

Enter the name of your mail server in ‘SMTP Host’ section. This is usually the ‘domain name’ or ‘mail.domain.com’. Make sure that the DNS for SMTP host resolves correctly.

Give port number as 25, the default SMTP port. For mail servers that use custom ports such as 587 for SMTP to avoid spamming, give that port.

It is also possible that certain mail servers restrict the access to their port 25 using firewall rules. In such cases, your IP should be white-listed in the firewall to avoid SMTP connect error.

To confirm that the connectivity to SMTP server and port is working fine, use the command:

telnet domain.com 25

Use the appropriate hostname and port number, after confirming that the SMTP connection is working fine. If the connectivity fails to establish, mail delivery will fail with the error ‘SMTP connect() failed‘.

2. SMTP authentication details

Every mail server has an authentication system to validate the users before allowing them to connect to it and send mails. In your Joomla Mail settings, turn this ON (YES).

Give the email account username and password. Enter the full ‘user@domain.com’ as the username in case of non-default accounts.

Whenever the email account password is changed or updated for security reasons, do not forget to change the password in ‘Mail settings’ also.

If the authentication details given are wrong, Joomla will fail to send mails and give the error ‘SMTP connect() failed‘.


Get a FREE consultation

Do you spend all day answering technical support queries?

Wish you had more time to focus on your business? Let us help you.

We free up your time by taking care of your customers and servers. Our engineers monitor your servers 24/7, and support your customers over help desk, live chat and phone.

Talk to our technical support specialist today to know how we can keep your service top notch!

TALK TO AN EXPERT NOW!




Bobcares provides Outsourced Hosting Support and Outsourced Server Management for online businesses. Our services include Hosting Support Services, server support, help desk support, live chat support and phone support.

7 Comments

  1. Hi,
    I have failed to get this to work with Joomla 3.6xx. I have done some research and I found others are having same issues. I have tried various things and performed every step you have listed for Gmail without success. Could you please help me?

    Reply
    • Larry,

      The issue could be due to some setting of SSL or mail server security feature. Only after checking the server for any mail delivery or connectivity issues with the gmail server, can we pinpoint the issue, if the other settings are fine. Please feel free to contact our 24/7 support team here – https://bobcares.com/contact-us/ – for a detailed investigation and further assistance.

      Reply
    • Hi Emma,

      We would need to cross-check your SMTP settings and mail server to figure out why the error happens for you. Feel free to contact our 24/7 support experts here – https://bobcares.com/contact-us/ – for a detailed investigation and further assistance.

      Reply
  2. I have follow the step and filled in all the details, but i get Joomla ‘SMTP connect() failed‘.

    What should i do.?

    Reply
    • Hi Sarah,

      We can help you with that. Click here to talk to our Joomla expert. We are online 24/7.

      Reply
  3. i got this too in joomla 3.8.11

    SMTP connect() failed‘.

    but this is only by use the test button, the fornailer on the page works perfect i think this is joomla internal core problem !?

    Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

Bobcares
Bobcares is a server management company that helps businesses deliver uninterrupted and secure online services. Our engineers manage close to 51,500 servers that include virtualized servers, cloud infrastructure, physical server clusters, and more.
MORE ABOUT BOBCARES