2010-10-24 111 views
1

我使用PHPMailer通过SMTP在共享服务器上发送电子邮件(我的托管服务是Softsys)。电子邮件正在发送到同一服务器上的电子邮件地址(即@域是我的网络域)。但是,当我试图改变收件人@gmail(或任何外部地址),我收到以下错误日志:PHPMailer SMTP错误550

SMTP -> get_lines(): $data was "" 
SMTP -> get_lines(): $str is "550 <[email protected]> No such user here" 
SMTP -> get_lines(): $data is "550 <[email protected]> No such user here" 
SMTP -> FROM SERVER:550 <[email protected]> No such user here 
SMTP -> ERROR: RCPT not accepted from server: 550 <[email protected]> No such user here 
SMTP -> get_lines(): $data was "" 
SMTP -> get_lines(): $str is "250 OK" 
SMTP -> get_lines(): $data is "250 OK" 
SMTP -> FROM SERVER: 250 OK 
Message could not be sent. 
Mailer Error: SMTP Error: The following recipients failed: [email protected] 

这是我的服务器或我的代码的问题吗?我应该只是联系我的服务器管理员?预先感谢您的任何帮助!

这里是我的代码

require("class.phpmailer.php"); 
$mail = new PHPMailer(); 

$mail->IsSMTP(); 
$mail->Host = "mail.mywebsite.com"; 
$mail->SMTPAuth = true; 
$mail->Username = "myemail"; 
$mail->Password = "********"; 
$mail->From = "[email protected]"; 
$mail->FromName = "John Doe"; 
$mail->AddAddress("[email protected]");  

$mail->IsHTML(true); 

$mail->Subject = "Here is the subject"; 
$mail->Body = "This is the HTML message body <b>in bold!</b>"; 
$mail->AltBody = "This is the body in plain text for non-HTML mail clients"; 

if(!$mail->Send()) 
{ 
    echo "Message could not be sent. <p>"; 
    echo "Mailer Error: " . $mail->ErrorInfo; 
    exit; 
} 

echo "Message has been sent"; 

回答

0

你拥有自己帐户的shell访问?然后,您可以使用命令“dig mx gmail.com”检查一些类似MX记录的内容。如果没有,最好的办法是与你联系Hoster。我想在同一台服务器上的某个人已经配置了域gmail.com。我猜他们正在使用exim作为MTA(因为消息响应)。 这可能是,该exim试图解决它自己的主机=本地交付,因为服务器上的gmail.com域。 您是否尝试过其他域名/电子邮件地址?

0

如果您尝试将电子邮件发送到Gmail,gmail说[email protected]不存在,请尝试使用[email protected](删除大写)。如果没有,那么尝试使用你真正知道的电子邮件。