Answer the question
In order to leave comments, you need to log in
How to remove this problem when sending emails?
When sending a letter to Yandex, the mail pops up for me (during debugging) this window:
2019-11-20 20:20:20 SERVER -> CLIENT: 220 iva8-e1a842234f87.qloud-c.yandex.net ESMTP (Want to use Yandex.Mail for your domain? Visit http://pdd.yandex.ru)<br>
2019-11-20 20:20:20 CLIENT -> SERVER: EHLO localhost<br>
2019-11-20 20:20:20 SERVER -> CLIENT: 250-iva8-e1a842234f87.qloud-c.yandex.net250-8BITMIME250-PIPELINING250-SIZE 42991616250-STARTTLS250-AUTH LOGIN PLAIN XOAUTH2250-DSN250 ENHANCEDSTATUSCODES<br>
2019-11-20 20:20:20 CLIENT -> SERVER: STARTTLS<br>
2019-11-20 20:20:20 SERVER -> CLIENT: 220 Go ahead<br>
2019-11-20 20:20:20 CLIENT -> SERVER: EHLO localhost<br>
2019-11-20 20:20:20 SERVER -> CLIENT: 250-iva8-e1a842234f87.qloud-c.yandex.net250-8BITMIME250-PIPELINING250-SIZE 42991616250-AUTH LOGIN PLAIN XOAUTH2250-DSN250 ENHANCEDSTATUSCODES<br>
2019-11-20 20:20:20 CLIENT -> SERVER: AUTH LOGIN<br>
2019-11-20 20:20:20 SERVER -> CLIENT: 334 VXNlcm5hbWU6<br>
2019-11-20 20:20:20 CLIENT -> SERVER: [credentials hidden]<br>
2019-11-20 20:20:21 SERVER -> CLIENT: 334 UGFzc3dvcmQ6<br>
2019-11-20 20:20:21 CLIENT -> SERVER: [credentials hidden]<br>
2019-11-20 20:20:21 SERVER -> CLIENT: 535 5.7.8 Error: authentication failed: Your message looks like spam. You need to use web for sending or prove you are not a robot using the following link http://ya.cc/6lIV<br>
2019-11-20 20:20:21 SMTP ERROR: Password command failed: 535 5.7.8 Error: authentication failed: Your message looks like spam. You need to use web for sending or prove you are not a robot using the following link http://ya.cc/6lIV<br>
SMTP Error: Could not authenticate.<br>
2019-11-20 20:20:21 CLIENT -> SERVER: QUIT<br>
2019-11-20 20:20:21 SERVER -> CLIENT: 221 2.0.0 Closing connection.<br>
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting<br>
use PHPMailer\PHPMailer\Exception;
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
require_once __DIR__ . '/PHPMailer/src/Exception.php';
require_once __DIR__ . '/PHPMailer/src/PHPMailer.php';
require_once __DIR__ . '/PHPMailer/src/SMTP.php';
class ContactMailer
{
private static $emailFrom = '';
private static $emailTo = '';
public static function send($name, $phone, $message, $source)
{
$body = "";
$mailer = new PHPMailer();
$mailer->SMTPDebug = 2;
$mailer->isSMTP();
$mailer->Host = 'smtp.yandex.ru';
$mailer->SMTPAuth = true;
$mailer->Username = self::$emailFrom;
$mailer->Password = 'Пароль';
$mailer->SMTPSecure = 'ssl';
$mailer->Port = '465';
$mailer->CharSet = 'UTF-8';
$mailer->setFrom(self::$emailFrom, 'Заголовок');
$mailer->addAddress(self::$emailTo);
$mailer->isHTML(false);
$mailer->Subject = 'Тема';
$mailer->Body = $body;
$mailer->isHTML(true);
if ($mailer->send()) {
return true;
}
return false;
}
}
Answer the question
In order to leave comments, you need to log in
You send mail to Yandex mailboxes for a domain that no longer exists
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question