Answer the question
In order to leave comments, you need to log in
Why does the error "Sender address rejected: not owned by auth user" occur when sending an email?
in general, I decided to start mail on pdd.yandex.ru.
Started for one site, set up sending to YII2 via swiftMailer, there were no problems at all, all letters from the site come.
Then I decided to do it with another site, it is on YII1 and on the same server. Downloaded the phpmailer library, code
ini_set('display_errors', true);
error_reporting(E_ALL);
include "PHPMailer-master/PHPMailerAutoload.php"; // include the class name
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = "smtp.yandex.ru";
$mail->Port = 465;
$mail->SMTPAuth = true;
$mail->Username = "[email protected];
$mail->Password = "pass";
$mail->SMTPSecure = 'ssl';
$mail->From = "[email protected]";
$mail->FromName = 'ilya';
$mail->AddAddress("[email protected]");
$mail->IsHTML(true);
$mail->Subject = 'test';
$mail->Body = $mail_body = "<html> <body>";
$mail_body = "<b>test<br>";
if(!$mail->Send())
{
echo 'Mailer Error: ' . $mail->ErrorInfo;
}
else
{
echo 'success';
}
?>
Mailer Error: The following From address failed: [email protected] : MAIL FROM command failed,Sender address rejected: not owned by auth user. ,553,5.7.1
SMTP server error: MAIL FROM command failed
Detail: Sender address rejected: not owned by auth user.
SMTP code: 553
Additional SMTP info: 5.7.1
Answer the question
In order to leave comments, you need to log in
$mail->From = "Ваш реальный email в Яндекс для подключенного домена";
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question