SMTP->错误:服务器不接受RCPT [英] SMTP -> ERROR: RCPT not accepted from server

查看:417
本文介绍了SMTP->错误:服务器不接受RCPT的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 require("phpmailer.inc.php");

class sendmail
{
public static function sendAccountActivateMail($to,$subject,&message)
{
    $flg = false;
    try
{
$mail= new PHPMailer(); 
$mail->IsSMTP(); 
$mail->SMTPAuth= true; 
$mail->SMTPSecure= "tls"; 
$mail->Host= "smtp.gmail.com"; 
$mail->Port= 587; 
$mail->Username= "xxx@mydomain.com"; 
$mail->Password= "xxxxxx"; 
$mail->AddReplyTo("info@mydomain.com"); 
$mail->From= "info@mydomain.com"; 
$mail->FromName= "Website"; 
$mail->Subject= $subject; 
$mail->WordWrap= 50; 
$mail->Body = $message; 
$mail->AddAddress($to); 
$mail->Send(); 
}
catch(Exception $e)
    {
        $flg = false;
    }
    return $flg;
}
}

尝试使用smtp通过phpmailer发送邮件. 打开调试会给我错误:

Trying to send mail through phpmailer with smtp. turning on debug gives me error:

SMTP->错误:未从服务器接受RCPT:550端口SMTP上的邮件提交需要550 SMTP AUTH->错误:服务器未接受DATA命令:SMTP->注意:检查连接是否成功,EOF被捕获

SMTP -> ERROR: RCPT not accepted from server: 550 SMTP AUTH is required for message submission on port 587 SMTP -> ERROR: DATA command not accepted from server: SMTP -> NOTICE: EOF caught while checking if connected

推荐答案

端口587似乎已被阻止.尝试使用

It looks like port 587 is blocked. Try using

$mail= new PHPMailer(); 
$mail->IsSMTP(); 
$mail->SMTPAuth= true; 
$mail->SMTPSecure= "ssl"; 
$mail->Host= "smtp.gmail.com"; 
$mail->Port= 465;.....

这篇关于SMTP->错误:服务器不接受RCPT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆