PHP Mailer - Error:SMTP connect() failed.

Hi Wieland and thank you for the reply.

Eventually, PHPMailer started working when configured with another SMTP server, with SMTP authentication ant SSL on port 465. I have no idea what is actually wrong with the SMTP server which was first in use, as there is no one setup which works with it anymore (it used to work without SSL/TLS before). Both SMTP servers work fine from other applications and computers.

I first suspected that the chosen password (which contained random characters) might have been the cause of the problem, part of it being interpreted as an escape character by a possibly faulty code gathered with a recent update. Wrong turn : setting a simple and short password did not fix the case.

I suspected then that the trouble might have come from the “Opportunistic TLS” feature of PHPMail, as the first server which we used was known to have a discrepancy between its X.509 wildcard certificate and its sub-domaine. This is why we used to connect to it without SSL/TLS from SuiteCRM. Interesting enough, the PHPMailer troubleshooting page states that PHPMailer “silently enables encryption automatically, even if you have not set SMTPSecure”. However the problem where not there ! Having corrected the discrepancy between certificate and domain, PHPMailer did not give better result.

The only workaround at the present time is to use another external SMTP server.

According to you, does PHPMailer logs the SMTP transactions somewhere ? I would be curious to understand why it works with a given SMTP server and not with another one, all setups being the same.

Regards.