SMTP connect() failed Cannot send mails from contat us form

Posted November 10, 2016 4k views
PHPJoomlaEmailConfiguration ManagementDigitalOcean 1-Click Apps MarketplaceCMS

I have a vanilla joomla installation using Digital Ocean’s one click app install. I installed RS form plugin to send emails from the contact us form.
However, when the user fills out the form he gets the message: “SMTP connect() failed”
A bit of background:
I tried to change the settings on joomla to send emails from my gmail.
Here are the mail settings of the configuration.php file:
Mail from:
mailer = smtp
sendmail = /usr/sbin/sendmail
fromname = myname
smtpuser: gmail username
smtp password: gmail password
smtp security: tls
SMTP Host:
i can connect via ssh to the terminal of my droplet

after doing so and executing the telnet command:” telnet 587” this is what I get:

myserver:~# telnet 587
Connected to
Escape character is ’^]’.
At least we can see that it is connecting.

As far as the mail logs goes here I’ve looked at them and only can see sender of joomla and not from myself

myserver:/var/log# ls -lhrt mail*
-rw-r—– 1 syslog adm 827 Jul 24 06:47 mail.log.4.gz
-rw-r—– 1 syslog adm 632 Jul 30 06:39 mail.log.3.gz
-rw-r—– 1 syslog adm 775 Aug 7 06:34 mail.log.2.gz
-rw-r—– 1 syslog adm 2.9K Nov 7 11:54 mail.log.1
-rw-r—– 1 syslog adm 0 Nov 8 06:51 mail.log
myserver:/var/log# grep joomla mail* | wc -l
myserver:/var/log# zgrep joomla mail* | wc -l
myserver:/var/log# grep myname mail* | wc -l
myserver:/var/log# zgrep myname mail* | wc -l
Any ideas on what may be the problem?


These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

After doing some digging on this issue it appears that you’ll need to take a couple extra steps within your gmail account in order to send via SMTP from Joomla.

This thread on the Joomla forums recommends:

You can get GMail to work with Joomla without modifying any code. Enable 2 step authentication on your Google account. In the Password & sign-in method in the Signing in to Google section of My Account you will now see an additional option, App Passwords. Generate a password for your website and use that in place of the regular one.