SMTP连接失败错误

时间:2015-06-17 16:50:48

标签: php email phpmailer

我正在努力解决这个问题几个小时没有成功。

2015-06-17 15:05:56 SERVER -> CLIENT: 220 PSS21.win.hostgator.com
2015-06-17 15:05:56 CLIENT -> SERVER: EHLO forexyahoofinance.mario26tech.com
2015-06-17 15:05:56 SERVER -> CLIENT: 250-PSS21.win.hostgator.com Hello [192.185.6.40] 250-SIZE 31457280 250-AUTH LOGIN CRAM-MD5 250 OK
2015-06-17 15:05:56 CLIENT -> SERVER: AUTH LOGIN
2015-06-17 15:05:56 SERVER -> CLIENT: 334 VXNlcm5hbWU6
2015-06-17 15:05:56 CLIENT -> SERVER: bWFyaW90ZWM=
2015-06-17 15:05:56 SERVER -> CLIENT: 334 UGFzc3dvcmQ6
2015-06-17 15:05:56 CLIENT -> SERVER: bUFyaW9AMjgxMA==
2015-06-17 15:05:56 SERVER -> CLIENT: 535 Authentication failed
2015-06-17 15:05:56 SMTP ERROR: Password command failed: 535 Authentication failed
2015-06-17 15:05:56 CLIENT -> SERVER: QUIT
2015-06-17 15:05:56 SERVER -> CLIENT: 221 Service closing transmission channel
2015-06-17 15:05:56 SMTP connect() failed.
        $mail = new PHPMailer();
$mail -> IsSMTP();
$mail -> SMTPDebug = 2;
$mail -> SMTPAuth = true;
$mail -> CharSet = 'UTF-8';

$mail -> Host = 'sns41.win.hostgator.com'; //nameserver ,i tried ip also.
$mail -> Username = "*****"; //hostgator username
$mail -> Password = '*****'; //hostgator pass

$mail -> SMTPSecure = 'ssl';
$mail -> Port = '465';

$mail -> FromName = $from_name;
$mail -> SetFrom = $fromEmail;
$mail -> AddAddress($toEmail);
$mail -> AddAddress('nikolaou_marios@hotmail.com',"Reply");
$mail -> addReplyTo("marios.nikolaou87@gmail.com", "Information");

$mail -> IsHTML(true);
$mail -> Subject = $subject;
$mail -> Body = $message;
$mail -> Send();


} catch (phpmailerException $e) {
  echo $e->errorMessage(); //rror messages from PHPMailer
} catch (Exception $e) {
  echo $e->getMessage(); //Error messages from anything else!
}

任何帮助将不胜感激。 提前谢谢。

0 个答案:

没有答案