After 7.4 upgrade = Error:SMTP connect failed

Hi Guys

I have had this error pop up after the upgrade when attempting to send emails

Error:SMTP connect() failed.
https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

I have had a look into the MyPHPMailer for 7.4 and it is = 5.2.13 which has been upgraded

Looking into the forum only thing I could find
https://suitecrm.com/forum/suitecrm-beta/6739-suitecrm-7-4-release-candidate-released#24528

Just wondering if there is anything we can do to resolve this?
Anybody else had the same issue

Thanks

Hi,

What version of 7.4 do you have? Is it one of the Betas, the RC or the Full release?
There were a couple of email issues in the RC and betas that were resolved in the Full Release.

The solution provided in the link you provided was implemented in the 7.4 Full release, so that should be resolved.

Ensure that you have the correct E-mail settings in the Admin > E-mail settings page.
Also check that your user profileā€™s E-mail settings are valid and correct. You can view these by clicking your name on the top-right of the CRM.

Hi -

Iā€™m experiencing the same problem. I have full version of 7.4 and checked if ā€œclass.smtp.phpā€ is called from /include/SugarPHPMailer.php, and still have the error message: Error:SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

Any help?

Guys relax.

If the email settings you are using is from gmail you have to turn on Access for less secure apps

smtp.gmail.com
TLS 587

This worked perfectly fine for me.

You might want to configure your firewall for the 587 port

Thanks for the quick response Jar. Unfortunately, Iā€™m not using gmail. Any other ideas?

Can you try turning your firewall then send the messages?
If you are using CentOS can you turn off also selinux?

I have tried it with my own mail smtp mail server and itā€™s working fine.

Got the same problem after upgrading from 7.3.-> 7.4. I am using ISPConfig 3 and PHP-FPM for my domain. Tested also with a clean 7.4 install, same problem with that.
I just noticed an error message in Apacheā€™s error.log. Unfortunately I donā€™t know what to do with it. Might have something to do with problem.

FastCGI: server ā€œ/var/xxx/cgi-bin/php5-fcgi-*-80-xxx.xxx.comā€ stderr: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed in /var/xxx/include/phpmailer/class.smtp.php on line 344, referer: http://xxx.xxx.com/index.php?module=EmailMan&action=config

Any progress on this anyone? Iā€™m having the same problem. Iā€™ve upgraded to the full version of 7.4, and now I just keep getting an error when attempting to test smtp in the E-mail settings. Doesnā€™t matter what service iā€™m using, iā€™ve tried every port with both gmail and zoho mail.

Hereā€™s the weird part. SMTP relaying works fine for individual accounts. For example: the primary account is ffxadmin. My account is lyanrocke. I can log in as lyanrocke and send / receive messages using the e-mail section.

Itā€™s just setting up the primary e-mail for notifications, reports, new account welcome messages, etc that is not working. Any suggestions?

Exact same problem here! :frowning:

E-mail used to work fine before upgrade, now ā€œError:SMTP connect() failed.ā€
The mail server is local, 192.168.0.14, doesnā€™t require authentication for local senders, no SSL/TLS. We run our own SMTP server (logs donā€™t show any connection attempt at all).

Hopefully someone figures this out fast, as it breaks our CRM big time! (All our workflow events send out E-mails to people to keep projects moving along)

-RoB-

1 Like

Same problem regarding SMTP connection failure. I am new to SuiteCRM and version 7.4 is my first download.
I have tested the email settings (not gmail) using Telnet and tested OKAY.

Please let me know if someone find a solution.

Found it! After some serious diggingā€¦

The hint was in jykaā€™s message: It indicates that SuiteCRM is not accepting a self-signed SSL certificate from the mail server. I didnā€™t think much of it, since I had SSL/TLS switched off in the SuiteCRM E-mail settings, it should just use plain text SMTP (our mail server is local, I donā€™t need encryption).

Turns out that SuiteCRM will ALWAYS use TLS if the mail server advertises it as available, regardless of your settings. It will kick in STARTTLS to switch a connection to port 25 over to TLS encryption if the server says it can do that. Our mail server supports SSL/TSL, we use it for all outside connections, and we use a self-signed certificate.

More digging shows this is caused by a default set in file /include/phpmailer/class.phpmailer.php

This file is part of the PHPMailer GitHub project, nothing to do with SuiteCRM per se, it just uses it. On line 257 in there you will find:

public $SMTPAutoTLS = true;

This will cause the mailer to always try to switch to TLS when available, and in the notes above it there a warning:

ā€œBe aware that in PHP >= 5.6 this requires that the serverā€™s certificates are validā€

So, if your PHP is up-to-date, it will only accept valid certificates, and self-signed wonā€™t work.

Set ā€œpublic $SMTPAutoTLS = false;ā€ and the mailer will stop trying to switch to TLS. And magically E-mail starts working again! B)
Of course if you do need SSL/TLS this wonā€™t help, youā€™ll have to import your key file to the system running SuiteCRM so it becomes part of the trusted certs. There are instructions on the Internet on how to go about this.

-RoB-

6 Likes

Hi,

Thanks RobB, works fine after your config change!

Jyka

My issue was resolved by going to the admin area and selecting REPAIR. The running ā€œQuick Repair and Rebuildā€ and ā€œRebuild Relationships.ā€ After that I was able to go back to E-mail Settings from the admin page and add my new Zoho account using SSL or TLS.

Great thank you RobB - solved my problem too :cheer:

Do you know where the following code should be added in the case that you have TLS/SSL

$mail->SMTPOptions = array(
ā€˜sslā€™ => array(
ā€˜verify_peerā€™ => false,
ā€˜verify_peer_nameā€™ => false,
ā€˜allow_self_signedā€™ => true
)
);

Thanks any help would be welcome. This is a real blocking issue.

Thanks! Setting

public $SMTPAutoTLS = false;

in class.phpmailer.php worked for me!

1 Like

Dear Sir! :slight_smile: Iā€™m very pleased that you got a solution to fix this problem. I was already quite a bit annoyed with this bug.
Thus - THANK you for helping me.

Greetings from Austria
Thomas

Hello All,
Iā€™m still having this issue, even changing from ā€˜autoā€™ to ā€˜falseā€™ the setting into php.mailer config file.
Is there any chance to have this issue solved? Other SugarCRM forks are still working correctly and some of my colleagues are pushing towards those CRMsā€¦ sigh!
Thanks in advance.
Regards.
Gianluca from Italy.

This means that the request is being blocked from your machine I suggest editing your firewall settings to allow port 587 in ubuntu use this command there is an equivalent commands for Centos as well
sudo ufw allow 587

1 Like

Unfortunately, Iā€™m still getting the error Error:SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
Is there someone other suggestion?
Thanks.
Gianluca.