Phpmailer: Getting this error after i updated my php version from 5.6 to php 7

Created on 30 Apr 2019  Â·  5Comments  Â·  Source: PHPMailer/PHPMailer

Help me out here please
Getting this error after i updated my php from 5.6 to 7

2019-04-30 12:59:53 SERVER -&gt; CLIENT: 220 smtp4p.mail.yandex.net ESMTP (Want to use Yandex.Mail for your domain? Visit http://pdd.yandex.ru)<br>
2019-04-30 12:59:53 CLIENT -&gt; SERVER: EHLO localhost<br>
2019-04-30 12:59:54 SERVER -&gt; CLIENT: 250-smtp4p.mail.yandex.net250-8BITMIME250-PIPELINING250-SIZE 42991616250-STARTTLS250-AUTH LOGIN PLAIN XOAUTH2250-DSN250 ENHANCEDSTATUSCODES<br>
2019-04-30 12:59:54 CLIENT -&gt; SERVER: STARTTLS<br>
2019-04-30 12:59:54 SERVER -&gt; CLIENT: 220 Go ahead<br>
SMTP Error: Could not connect to SMTP host.<br>
2019-04-30 12:59:54 CLIENT -&gt; SERVER: QUIT<br>
2019-04-30 12:59:54 SERVER -&gt; CLIENT: <br>
2019-04-30 12:59:54 SMTP ERROR: QUIT command failed: <br>
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting<br>
message not sent please try again

here is how i have set up my code

$mail->isSMTP();
$mail->SMTPDebug = 2;
$mail->Host = 'smtp.yandex.com';
$mail->SMTPAuth = true;
$mail->Username = '[email protected]';
$mail->Password = 'secret';
$mail->SMTPSecure = 'tls';
$mail->Port = 587;

Most helpful comment

Please read the troubleshooting guide linked from the error message, and in the issue template (which you deleted). It describes how to diagnose and fix this exact problem (the connection failing immediately after STARTTLS). It's likely that your CA certificate bundle is out of date, or you're missing the openssl extension.

All 5 comments

Please read the troubleshooting guide linked from the error message, and in the issue template (which you deleted). It describes how to diagnose and fix this exact problem (the connection failing immediately after STARTTLS). It's likely that your CA certificate bundle is out of date, or you're missing the openssl extension.

How to I get this updated CA certificate bundle updated, or get this OpenSSL extension in my local pc please.

The guide tells you how to update your CA certs. I can't help you with installing the extension - please refer to the PHP docs, or whatever installer you're using for PHP (eg. XAMPP).

Outgoing mail

mail server address — smtp.yandex.com
connection security — TLS/SSL
port — 465

https://yandex.com/support/mail/mail-clients/ssl.html

Its now working

Was this page helpful?
0 / 5 - 0 ratings