Answer the question
In order to leave comments, you need to log in
PHPMailer does not work with Yandex smtp. Wrong login or password?
Hello. Can't connect to Yandex smtp server via phpmailer. An error
SMTP -> ERROR: Password not accepted from server: 535 Incorrect authentication data
SMTP Error: Could not authenticate.
require 'mailer/class.phpmailer.php';
$Mailer = new PHPMailer();
$Mailer->SMTPDebug = 1;
$Mailer->CharSet = 'UTF-8';
$Mailer->IsSMTP();
$Mailer->Host = 'smtp.yandex.ru';
$Mailer->Port = 25;
$Mailer->SMTPAuth = true;
$Mailer->Username = '[email protected]';
$Mailer->Password = 'password';
$Mailer->SetFrom('[email protected]', 'Владимир');
$Mailer->AddAddress($_GET['email'], $_GET['name']);
$Mailer->Subject = 'Проверка отправки почты';
$Mailer->Body = 'Тестовое сообщение.';
if($Mailer->Send()) echo 'true'; else echo 'false';
Answer the question
In order to leave comments, you need to log in
The problem was that I was transferring mail for a domain from one Yandex account to another. A day later, the smtp connection itself worked, with the same data and settings.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question