验证失败[SMTP: Invalid response code from server (code: 535, res


authentication failure [SMTP: Invalid response code received from server (code: 535, response: 5.7.0 ...authentication rejected)]

当我执行php脚本时,它给了我一个错误

authentication failure [SMTP: Invalid response code received from server (code: 535, response: 5.7.0…]认证拒绝)

这是我的php脚本,我确定密码和用户名是正确的

 $from="postmaster";
$headers = array ('From' => $from,
'To' => $to,
'Subject' => $subject
);

$host="ssl://smtp.aruba.it";
$port="465";
$username="info@****.com";
$password="*****";

$body = $mime -> get();
$headers = $mime -> headers($headers);
$smtp= Mail::factory('smtp',array('host'=>$host, 'port'=>$port,'auth' => true,
    'username' => $username,
    'password' => $password));

$query="SELECT * from payment where iduser='$iduser'";
$result=mysql_query($query);
while ($row=mysql_fetch_array($result)) {
    if ($row['amount'] > 0)
$mail = $smtp->send($to, $headers, $body);
if (PEAR::isError($mail)) {
  echo("<p>" . $mail->getMessage() . "</p>");
 }

Google必须允许你的应用程序使用你自己的帐户,要允许这个Google提供了一个简单的方法,只需去https://accounts.google.com/DisplayUnlockCaptcha,然后点击继续,然后用10分钟,使用你的应用程序尝试再次发送电子邮件,Google会记住应用程序/服务,并允许你的应用程序访问你的帐户,只要你不更改你的密码。