I
I
Ilya Beloborodov2017-02-25 13:03:14
PHP
Ilya Beloborodov, 2017-02-25 13:03:14

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';
}


?>

and here is the error:
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

what is it and how to fix it. a day later, I didn’t google anything sensible ((

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
Fuze, 2017-02-25
@kowap

$mail->From = "Ваш реальный email в Яндекс для подключенного домена";

Most likely the one specified in Username.

E
Eugene D., 2017-02-25
@devg

"Sender address rejected: not owned by auth user"
This means:
You need to specify in the sender the address of the real mailbox on the bound domain for which you specify the login password:
$mail->From = "[email protected]";

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question