Answer the question
In order to leave comments, you need to log in
Phpmailer: how to do mass mailing?
Hi all!
I'm trying to do mass mailing but it doesn't work.
Here is the error
ErrorSMTP Error: Data not accepted. SMTP server error: 5.7.1 Message rejected under suspicion of SPAM; https://yandex.ru/support/mail/spam/honest-mailers.xml 1460734462-Z5k54JZeXJ-YK6GcjG6
What should I do to make it work.
By the way, the code is on hosting. There is no domain name.
$mail = new PHPMailer(true);
$send_using_gmail = true;
//Send mail using gmail
if($send_using_gmail){
$mail->IsSMTP(); // telling the class to use SMTP
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SMTPSecure = "ssl"; // sets the prefix to the servier
$mail->CharSet = 'UTF-8';
$mail->Host = "smtp.yandex.ru"; //
$mail->Port = 465; // set the SMTP port for the GMAIL server
$mail->Username = "[email protected]"; //
$mail->Password = "g21"; //
}
$msg_title = "dfdfd";
$msg_body = "dfdfdf";
/
$emails = [....]; // тут ассоциативный массив емайл=>Фио
foreach($emails as $k=>$v)
$mail->AddAddress($v, $k);
$mail->AddReplyTo("[email protected]","TEST");
$mail->SetFrom("[email protected]", "Infoarmation (Test)");
$mail->Subject =$msg_title;
$mail->Body = $msg_body;
try{
$mail->Send();
echo "Success!";
} catch(Exception $e){
//Something went bad
echo "Fail - " . $mail->ErrorInfo;
}
Answer the question
In order to leave comments, you need to log in
Yandex prohibits mass mailings, especially from regular mailboxes.
Provide at least the text of the letter.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question