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.