PHPMailer EOF错误;连接失败。无法进行身份验证

时间:2016-10-03 13:20:58

标签: php phpmailer

我收到了EOF错误。我使用基本模板和一些加法(附件,cc等)和一个加法(AuthType='PLAIN')。

<?php
require __DIR__ . '/vendor/autoload.php';

$mail = new PHPMailer;

$mail->SMTPDebug = 4;                               // Enable verbose debug output

$mail->isSMTP();                                      // Set mailer to use SMTP
$mail->Host = 'smtp.zoho.com';  // Specify main and backup SMTP servers
$mail->SMTPAuth = true;                               // Enable SMTP authentication
$mail->AuthType = 'PLAIN';
$mail->Username = '*******';                 // SMTP username
$mail->Password = '*******';                           // SMTP password
$mail->SMTPSecure = 'tls';                         // Enable TLS encryption, `ssl` also accepted
$mail->Port = 587;                                 // TCP port to connect to

$mail->setFrom('*************', '*****');
$mail->addAddress('*********', '******');     // Add a recipient

$mail->isHTML(true);                                  // Set email format to HTML

$mail->Subject = 'From phpmailer-test.php';
$mail->Body    = 'This is the HTML message body <b>in bold!</b>';
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';

if(!$mail->send()) {
     echo 'Message could not be sent.';
     echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
     echo 'Message has been sent';
}
?>

- 我已经通过这个脚本和telnet通过465尝试了STMP并得到了同样的错误。

- 我已经用tls和587用这个脚本(但不是telent)对此进行了测试并得到了这个错误。

- 根据“故障排除”页面的说明,我使用了作曲家。

-Script位于phillyguitarlessons.com,邮件帐户位于*@kalegood.com(由zoho.com托管)。我不认为这会导致错误,但我不确定。

- 我已经尝试浏览文档(通过页面搜索&#34; EOF&#34;)并没有发现任何内容。

- 从我的VPS,我的端口应该是敞开的。到zoho.com

-Opensssl已激活(通过info.php确认)

输出(切换到调试级别2):

2016-10-03 13:47:40 SERVER -> CLIENT: 220 mx.zohomail.com SMTP Server ready October 3, 2016 6:47:40 AM PDT 
2016-10-03 13:47:40 CLIENT -> SERVER: EHLO phillyguitarlessons.com 
2016-10-03 13:47:40 SERVER -> CLIENT: 250-mx.zohomail.com Hello phillyguitarlessons.com (162.243.32.109 (162.243.32.109)) 250-STARTTLS 250 SIZE 53477376 
2016-10-03 13:47:40 CLIENT -> SERVER: STARTTLS 
2016-10-03 13:47:40 SERVER -> CLIENT: 220 Ready to start TLS. 
2016-10-03 13:47:41 CLIENT -> SERVER: EHLO phillyguitarlessons.com 
2016-10-03 13:47:41 SERVER -> CLIENT: 250-mx.zohomail.com Hello phillyguitarlessons.com (162.243.32.109 (162.243.32.109)) 250-AUTH LOGIN PLAIN 250 SIZE 53477376 
2016-10-03 13:47:41 CLIENT -> SERVER: AUTH PLAIN 
2016-10-03 13:49:46 SERVER -> CLIENT: 334 
2016-10-03 13:49:46 SMTP NOTICE: EOF caught while checking if connected 
2016-10-03 13:49:46 SMTP Error: Could not authenticate. 
2016-10-03 13:49:46 SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting Message could not be sent.Mailer Error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

0 个答案:

没有答案