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 -> 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 -> SERVER: EHLO localhost<br>
2019-04-30 12:59:54 SERVER -> 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 -> SERVER: STARTTLS<br>
2019-04-30 12:59:54 SERVER -> CLIENT: 220 Go ahead<br>
SMTP Error: Could not connect to SMTP host.<br>
2019-04-30 12:59:54 CLIENT -> SERVER: QUIT<br>
2019-04-30 12:59:54 SERVER -> 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;
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).
mail server address — smtp.yandex.com
connection security — TLS/SSL
port — 465
Its now working
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.