phpmailer smtp错误connect()失败了相同的帐户,但不同的主机

时间:2016-03-23 18:52:31

标签: php smtp gmail phpmailer sendmail

新项目在我的主持人工作正常my host

但未使用此主机new host

它显示了这个

2016-03-23 15:06:11 Connection: opening to smtp.gmail.com:587,timeout=300,options=array ( )
2016-03-23 15:06:11 Connection: opened 2016-03-23 15:06:11 SMTP -> get_lines(): $data is ""
2016-03-23 15:06:11 SMTP -> get_lines(): $str is "220-server.zaaan.com ESMTP Exim 4.86_1 #1 Wed, 23 Mar 2016 15:06:11 +0000 "
2016-03-23 15:06:11 SMTP -> get_lines(): $data is "220-server.zaaan.com ESMTP Exim 4.86_1 #1 Wed, 23 Mar 2016 15:06:11 +0000 "
2016-03-23 15:06:11 SMTP -> get_lines(): $str is "220-We do not authorize the use of this system to transport unsolicited, "
2016-03-23 15:06:11 SMTP -> get_lines(): $data is "220-server.zaaan.com ESMTP Exim 4.86_1 #1 Wed, 23 Mar 2016 15:06:11 +0000 220-We do not authorize the use of this system to transport unsolicited, "
2016-03-23 15:06:11 SMTP -> get_lines(): $str is "220 and/or bulk e-mail. " 2016-03-23 15:06:11 SERVER -> CLIENT: 220-server.zaaan.com ESMTP Exim 4.86_1 #1 Wed, 23 Mar 2016 15:06:11 +0000 220-We do not authorize the use of this system to transport unsolicited, 220 and/or bulk e-mail.
2016-03-23 15:06:11 CLIENT -> SERVER: EHLO www.mylifeeg.com 2016-03-23 15:06:11 SMTP -> get_lines(): $data is ""
2016-03-23 15:06:11 SMTP -> get_lines(): $str is "250-server.zaaan.com Hello www.mylifeeg.com [198.20.126.236] " 2016-03-23 15:06:11 SMTP -> get_lines(): $data is "250-server.zaaan.com Hello www.mylifeeg.com [198.20.126.236] " 2016-03-23 15:06:11 SMTP -> get_lines(): $str is "250-SIZE 52428800 " 2016-03-23 15:06:11 SMTP -> get_lines(): $data is "250-server.zaaan.com Hello www.mylifeeg.com [198.20.126.236] 250-SIZE 52428800 "
2016-03-23 15:06:11 SMTP -> get_lines(): $str is "250-8BITMIME "
2016-03-23 15:06:11 SMTP -> get_lines(): $data is "250-server.zaaan.com Hello www.mylifeeg.com [198.20.126.236] 250-SIZE 52428800 250-8BITMIME " 2016-03-23 15:06:11 SMTP -> get_lines(): $str is "250-PIPELINING " 
2016-03-23 15:06:11 SMTP -> get_lines(): $data is "250-server.zaaan.com Hello www.mylifeeg.com [198.20.126.236] 250-SIZE 52428800 250-8BITMIME 250-PIPELINING "
2016-03-23 15:06:11 SMTP -> get_lines(): $str is "250-AUTH PLAIN LOGIN "    2016-03-23 15:06:11 SMTP -> get_lines(): $data is "250-server.zaaan.com Hello www.mylifeeg.com [198.20.126.236] 250-SIZE 52428800 250-8BITMIME 250-PIPELINING 250-AUTH PLAIN LOGIN " 2016-03-23 15:06:11 SMTP -> get_lines(): $str is "250-STARTTLS " 2016-03-23 15:06:11 SMTP -> get_lines(): $data is "250-server.zaaan.com Hello www.mylifeeg.com [198.20.126.236] 250-SIZE 52428800 250-8BITMIME 250-PIPELINING 250-AUTH PLAIN LOGIN 250-STARTTLS " 2016-03-23 15:06:11 SMTP -> get_lines(): $str is "250 HELP " 2016-03-23 15:06:11 SERVER -> CLIENT: 250-server.zaaan.com Hello www.mylifeeg.com [198.20.126.236] 250-SIZE 52428800 250-8BITMIME 250-PIPELINING 250-AUTH PLAIN LOGIN 250-STARTTLS 250 HELP 2016-03-23 15:06:11 CLIENT -> SERVER: STARTTLS 2016-03-23 15:06:11 SMTP -> get_lines(): $data is "" 2016-03-23 15:06:11 SMTP -> get_lines(): $str is "220 TLS go ahead " 2016-03-23 15:06:11 SERVER -> CLIENT: 220 TLS go ahead 2016-03-23 15:06:11 CLIENT -> SERVER: EHLO www.mylifeeg.com 2016-03-23 15:06:11 SMTP -> get_lines(): $data is "" 2016-03-23 15:06:11 SMTP -> get_lines(): $str is "250-server.zaaan.com Hello www.mylifeeg.com [198.20.126.236] " 2016-03-23 15:06:11 SMTP -> get_lines(): $data is "250-server.zaaan.com Hello www.mylifeeg.com [198.20.126.236] " 2016-03-23 15:06:11 SMTP -> get_lines(): $str is "250-SIZE 52428800 " 2016-03-23 15:06:11 SMTP -> get_lines(): $data is "250-server.zaaan.com Hello www.mylifeeg.com [198.20.126.236] 250-SIZE 52428800 " 2016-03-23 15:06:11 SMTP -> get_lines(): $str is "250-8BITMIME " 2016-03-23 15:06:11 SMTP -> get_lines(): $data is "250-server.zaaan.com Hello www.mylifeeg.com [198.20.126.236] 250-SIZE 52428800 250-8BITMIME " 2016-03-23 15:06:11 SMTP -> get_lines(): $str is "250-PIPELINING " 2016-03-23 15:06:11 SMTP -> get_lines(): $data is "250-server.zaaan.com Hello www.mylifeeg.com [198.20.126.236] 250-SIZE 52428800 250-8BITMIME 250-PIPELINING " 2016-03-23 15:06:11 SMTP -> get_lines(): $str is "250-AUTH PLAIN LOGIN " 2016-03-23 15:06:11 SMTP -> get_lines(): $data is "250-server.zaaan.com Hello www.mylifeeg.com [198.20.126.236] 250-SIZE 52428800 250-8BITMIME 250-PIPELINING 250-AUTH PLAIN LOGIN " 2016-03-23 15:06:11 SMTP -> get_lines(): $str is "250 HELP " 2016-03-23 15:06:11 SERVER -> CLIENT: 250-server.zaaan.com Hello www.mylifeeg.com [198.20.126.236] 250-SIZE 52428800 250-8BITMIME 250-PIPELINING 250-AUTH PLAIN LOGIN 250 HELP 2016-03-23 15:06:11 Auth method requested: UNKNOWN 2016-03-23 15:06:11 Auth methods available on the server: PLAIN,LOGIN 2016-03-23 15:06:11 Auth method selected: LOGIN 2016-03-23 15:06:11 CLIENT -> SERVER: AUTH LOGIN 2016-03-23 15:06:11 SMTP -> get_lines(): $data is "" 2016-03-23 15:06:11 SMTP -> get_lines(): $str is "334 VXNlcm5hbWU6 " 2016-03-23 15:06:11 SERVER -> CLIENT: 334 VXNlcm5hbWU6 2016-03-23 15:06:11 CLIENT -> SERVER: bW9tYWl6Lm5ldEBnbWFpbC5jb20= 2016-03-23 15:06:11 SMTP -> get_lines(): $data is "" 2016-03-23 15:06:11 SMTP -> get_lines(): $str is "334 UGFzc3dvcmQ6 " 2016-03-23 15:06:11 SERVER -> CLIENT: 334 UGFzc3dvcmQ6 2016-03-23 15:06:11 CLIENT -> SERVER: MDEwMjc5ODc5MzI= 2016-03-23 15:06:13 SMTP -> get_lines(): $data is ""

2016-03-23 15:06:13 SMTP -> get_lines(): $str is "535 Incorrect authentication data "
2016-03-23 15:06:13 SERVER -> CLIENT: 535 Incorrect authentication data 2016-03-23 15:06:13 SMTP ERROR: Password command failed: 535 Incorrect authentication data 2016-03-23 15:06:13 SMTP Error: Could not authenticate. 2016-03-23 15:06:13 CLIENT -> SERVER: QUIT
2016-03-23 15:06:13 SMTP -> get_lines(): $data is ""
2016-03-23 15:06:13 SMTP -> get_lines(): $str is "221 server.zaaan.com closing connection "
2016-03-23 15:06:13 SERVER -> CLIENT: 221 server.zaaan.com closing connection
2016-03-23 15:06:13 Connection: closed
2016-03-23 15:06:13 SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting Mail Error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

我的功能是

function send_email($emails = array() , $title = '', $msg = '')
{
require_once (__DIR__ . '/mail/PHPMailerAutoload.php');

$mail = new PHPMailer;
$mail->SMTPDebug = 4;
$mail->isSMTP();
$mail->Host = 'smtp.gmail.com';
$mail->Username = 'momaiz.net@gmail.com' ;
$mail->Password = 'my password';
$mail->SMTPSecure = 'tls' ;
$mail->Port = 587 ;
$mail->SMTPAuth = true;
$mail->CharSet = 'UTF-8';
$mail->setFrom( 'safy.php@gmail.com' , 'Hyate Marriage' );
if (is_array($emails))
    {
    foreach($emails as $e)
        {
        $mail->addAddress($e, $e);
        }
    }
  else
    {
    $mail->addAddress($emails, $emails);
    }

$mail->isHTML(true);
$mail->Subject = $title;
$mail->Body = $msg;
$mail->AltBody = $msg;
if (!$mail->send())
    {
    echo 'Mail Error: ' . $mail->ErrorInfo;
    return false;
    }
  else
    {
    return true;
    }
}

服务器支持说每件事都没问题,

但我无法配置问题

我允许gmail低级别访问

未使用谷歌2步骤验证

在新服务器上启用openssl

新服务器已禁用功能。 你可以检查=>新网站网址?info = 01069374995

0 个答案:

没有答案