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

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 Trying… 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 18 myserver:/var/log# zgrep joomla mail* | wc -l 87 myserver:/var/log# grep myname mail* | wc -l 0 myserver:/var/log# zgrep myname mail* | wc -l 0 Any ideas on what may be the problem?



Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

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.