phpmailer不发送电子邮件(安全失败)

时间:2017-12-09 13:16:49

标签: smtp phpmailer

这是我正在使用的代码:

$mail = new PHPMailer;
$mail->isSMTP();
$mail->SMTPDebug = 2;
$mail->Debugoutput = 'html';
$mail->Host = "server.example.com'";
$mail->Port = 587;
$mail->SMTPAuth = true;
$mail->Username = "noreply@example.com'";
$mail->Password = "password";  
$mail->setFrom('from@example.com', 'First Last');
$mail->addReplyTo('replyto@example.com', 'First Last');
$mail->addAddress('to@example.com'', 'John Doe');
$mail->Subject = 'PHPMailer SMTP test';
$mail->msgHTML("hello you ");
$mail->AltBody = 'This is a plain-text message body';
if (!$mail->send()) {
  echo "Mailer Error: " . $mail->ErrorInfo;
} 
else {
  echo "Message sent!";
}

这是我使用debug

获得的错误代码

服务器 - &gt;客户:220-server.example.com ESMTP Exim 4.89#1星期六,09十二月2017 06:56:21 -0600 220-我们不授权使用此系统来传输未经请求的,220和/或批量电子邮件。     客户 - &gt;服务器:EHLO example.com     服务器 - &gt;客户:250-server.example.com Hello example.com [ 。* < / strong>] 250-SIZE 52428800250-8BITMIME250-PIPELINING250-AUTH PLAIN LOGIN250-STARTTLS250帮助     客户 - &gt;服务器:STARTTLS     服务器 - &gt;客户:220 TLS继续     SMTP错误:无法连接到SMTP主机。     客户 - &gt;服务器:退出     服务器 - &gt;客户端:安全性失败554安全性失败     SMTP错误:QUIT命令失败:安全性失败554安全性失败     SMTP connect()失败。 https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting     邮件程序错误:SMTP连接()失败。 https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

这里有什么问题?

0 个答案:

没有答案