这个问题在这里已有答案:
我让我的phpmailer在我的网站上工作,我的意思是它可以发送电子邮件。
但它会在发送电子邮件时始终显示此消息
SMTP -> FROM SERVER:000-XXXX.rumahweb.com ESMTP Exim 4.91 #1 Sun, 17 Mar 2019 05:45:58 +0700 220-We do not authorize the use of this system to transport unsolicited, 220 and/or bulk e-mail.
任何人都有想法?
include "../php/phpmailer/class.phpmailer.php";
/***************** Configuration *****************/
$mail = new PHPMailer;
$mail->IsSMTP();
$mail->SMTPSecure = 'tls';
$mail->Host = "xxxxxxxxxxxx"; //hostname masing-masing provider email
$mail->SMTPDebug = 2;
$mail->Port = 587;
$mail->SMTPAuth = true;
$mail->Username = "xxxxxxxxxx"; //user email
$mail->Password = "xxxxxxxxxxxxx"; //password email
$mail->SetFrom("[email protected]","Nama pengirim yang muncul"); //set email pengirim
$mail->Subject = "Pemberitahuan Email dari Website"; //subyek email
$mail->AddAddress("[email protected]","Nama penerima yang muncul"); //tujuan email
$mail->MsgHTML("Testing…");
$SEND = $mail->Send();
if($SEND){
echo "OK";
}
else
{
echo "Failed to sending message";
}
那不是错误。禁用调试输出:
$mail->SMTPDebug = false;