梨邮件 - 收件人地址被拒绝 - 错误

时间:2011-03-18 15:45:52

标签: php pear

我使用Pear Mail遇到以下错误:

Notice: Error in sending mail: Failed to add recipient: user@domain.com [SMTP: Invalid response code received from server (code: 550, response: 5.1.1 : Recipient address rejected: User unknown in virtual mailbox table)] in /PEAR/PEAR.php on line 873

电子邮件未发送。其他电子邮件地址(如Gmail和Yahoo)正常运行。据我所知,它只是特定电子邮件客户端的错误。

我使用以下脚本发送排队的邮件:

require_once "Mail/Queue.php";

$db_options['type']        = 'mdb2';
$db_options['dsn']         = 'mysql://username:password@localhost/db';
$db_options['mail_table']  = 'mailqueue';
$mail_options['driver']    = 'smtp';
$mail_options['host']      = 'hostAddress';
$mail_options['port']      = 25;
$mail_options['localhost'] = 'localhost'; //optional Mail_smtp parameter
$mail_options['auth']      = false;
$mail_options['username']  = 'user@domain.com';
$mail_options['password']  = 'password'; 

$max_amount_mails = 100;
$mail_queue =& new Mail_Queue($db_options, $mail_options);
$mail_queue->sendMailsInQueue($max_amount_mails);

有没有人知道为什么会对特定地址造成此错误?

我正在运行PHP5.2 / Apache2(CentOS 5.5)/ Pear Mail 1.2.0 / Pear Mail Queue 1.2.6 /

谢谢

2 个答案:

答案 0 :(得分:2)

我的天哪,错误信息的填充多于错误!让我们把它分开一点。

Notice: 
Error in sending mail: 
Failed to add recipient: user@domain.com 
[SMTP: 
Invalid response code received from server 
(code: 550, 
response: 5.1.1 : 
Recipient address rejected: 
User unknown in virtual mailbox table)]

最后一行是我们唯一关心的。

SMTP服务器查找您正在使用的地址,并抱怨无法找到该用户。换句话说,地址是虚假的并被拒绝。

答案 1 :(得分:1)

以某种方式,收件人的电子邮件被视为本地邮件(例如domain.com点在您的本地服务器上,并且您的计算机上不存在用户名。在该收件人的域上进行DNS查找并查看他们的MX设置是:

$ host -t mx domain.com
domain.com mail is handled by 10 someserver.domain.com
$ host someserver.domain.com
someserver.domain.com has address x.x.x.x

MX主机可能是一个“gag”域,例如localhost,或者MX服务器的IP为127.0.0.1,这会欺骗垃圾邮件发送者自己发送垃圾邮件。