我正在使用PHP郵件程序類。我越來越: SMTP錯誤:下面的收件人失敗:[email protected]Php郵件錯誤:SMTP錯誤
$mail = new phpMailer();
$body = "Hello, this is a test mail.";
//$body = preg_replace('/\\\\/','', $body); //Strip backslashes
$mail->IsSMTP(); // tell the class to use SMTP
//$mail->SMTPAuth = true; // enable SMTP authentication
//$mail->Port = 25; // set the SMTP server port
$mail->Host = "localhost"; // SMTP server
$mail->Username = "localhost"; // SMTP server username
$mail->Password = "password"; // SMTP server password
//$mail->SMTPSecure = "tls";
//$mail->IsSendmail(); // tell the class to use Sendmail
$mail->AddReplyTo("[email protected]","First Last");
$mail->From = "[email protected]";
$mail->FromName = "First Last";
$to = "[email protected]";
$mail->AddAddress($to);
$mail->Subject = "First PHPMailer Message";
$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
$mail->WordWrap = 80; // set word wrap
$mail->MsgHTML($body);
$mail->IsHTML(true); // send as HTML
if($mail->Send()){
echo 'Message has been sent.';
}
什麼能是什麼原因?
你明白這個從函數的返回值,或者是通過電子郵件發送給您的目標域的郵政局長? – slugonamission
@slugonamission考慮到有被印在上面的代碼中沒有錯誤消息,我猜它是從目標域中的反彈電子郵件...... –
沒有no..this錯誤,我通過PHPMailer的類獲得。所以它不是來自目標域。 – Shades88