我正在使用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