PHPList not able to connect to smtp server

1.3k Views Asked by At

Please guys help me.

This is my config:

$mail->SMTPAuth = true;
define('PHPMAILERHOST', 'tonyfintech.info'); 
$phpmailer_smtpuser = '[email protected]'; 
$phpmailer_smtppassword = 'azerty123';
$phpmailer_smtpport = '587'; 

$phpmailer_smtpsecure = 'tls';
$mail->SMTPOptions = array(
        'ssl' => array(
            'verify_peer' => false,
            'verify_peer_name' => false,
            'allow_self_signed' => false
        )
    );


define('TEST', 0);
define('PHPMAILER_SMTP_DEBUG', 1);

I still have this error:
2018-10-30 21:04:23 CLIENT -> SERVER: EHLO tonyfintech.info
2018-10-30 21:04:23 CLIENT -> SERVER: STARTTLS
SMTP Error: Could not connect to SMTP host.
2018-10-30 21:04:23 CLIENT -> SERVER: QUIT

This configuration works well in my other server but not this one. By the way, When I send an email using PHPMailer "just for testing" , it works with no issue . The issue come from PHPList

1

There are 1 best solutions below

2
Synchro On

The fact that it works on one server but not another suggests it's an environmental problem, not your code. The most likely explanation is that your server's CA certificate bundle is outdated, which is covered extensively on here and in the PHPMailer troubleshooting guide.

You should not be disabling certificate verification, though at a guess I'd say that PHPList isn't using your PHPMailer instance, which is probably why it's failing, because the certificate verification disabling you've done only applies to PHPMailer, not PHPList.

Fix your certificates and it will work in both.