繁体   English   中英

PHPMailer-SMTP错误:密码命令失败

[英]PHPMailer - SMTP ERROR: Password command failed

因此,我想通过smtp服务器发送电子邮件,但无法正常工作。

require_once "PHPMailer/class.phpmailer.php";
$mail = new PHPmailer();
$mail->SetLanguage("fr", "PHPMailer/language/");
$sujet = 'Hello World';
$texteHTML = 
'<html>
<body>
    <h1>Test envoi</h1>
</body>
</html>';
$mail->IsSMTP();
$mail->SMTPDebug = 3;

$mail->IsHTML(true);
$mail->Host= 'smtp.orange.fr'; // Serveur SMTP
$mail->From= '******@*****.fr';
  // Authentification
$mail->SMTPAuth=true;
$mail->Username = '*******';           // SMTP username
$mail->Password = ''; // The password is really empty, nada, nothing. Is it possible ?
$mail->Port = 25;
$adresse = '*****@gmail.com';
$mail->AddAddress($adresse);
$mail->Subject=$sujet;
$mail->Body=$texteHTML;
$erreur=false;
if(!$mail->Send())
{
    echo "PHPMailer - ";
    echo $mail->ErrorInfo; //Affiche le message d'erreur
    echo "";
    $erreur=true;
}
$mail->SmtpClose();
unset($mail);

我得到这个错误

2014-02-04 14:21:52 CLIENT -> SERVER:
2014-02-04 14:21:52 SERVER -> CLIENT: 501 5.7.0 invalid LOGIN encoding
2014-02-04 14:21:52 SMTP ERROR: Password command failed: 501 5.7.0 invalid LOGIN encoding
2014-02-04 14:21:52 CLIENT -> SERVER: QUIT

我的登录名和密码正确。 如果没有密码,PHPMailer是否可以工作?

谢谢你的时间。

从您收到的答案中:“无效的LOGIN编码” ...该主机解码的空密码会导致空值。

查看class.smtp.php(第245行):

fputs($this->smtp_conn, base64_encode($password) . $this->CRLF);

您的空字符串已编码

和第256行:

echo "SMTP -> ERROR: " . $this->error["error"] .": " . $rply . $this->CRLF;

表示消息是从主机而不是程序创建的。

我的猜测不是,不可能使用空密码。

顺便说一句,我从未见过没有密码的电子邮件帐户。

HIH,

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM