I am running into the following error using 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
The email is not sent. Other email addresses such as Gmail and Yahoo are working OK. It only errors for specific email clients, as far as I am aware.
I am using the following script to send the queued mail:
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);
Does anyone have any ideas why this error would be caused for specific addresses?
I am running PHP5.2/Apache2(CentOS 5.5)/Pear Mail 1.2.0/Pear Mail Queue 1.2.6/
Thank you
My goodness, that error message has more padding than error! Let’s split it out a bit.
That last line is the only one we care about.
The SMTP server looked up the address you were using and is complaining that the user could not be located. In other words the address is bogus and is being rejected.