PEAR Mail_Queue stops on recipient bad syntax

281 views Asked by At

i'm using PEAR Mail_Queue, everything works great, except when i'm trying to send emails to "bad" recipients (bad syntax like "ò[email protected]", "uuu@test,com" , "[email protected]")

When the queue finds a bad recipient it just stops, leaving all the others mail in the db queue table...

I just want to make it jump to the next mail, deleting (or not) the bad mail in the queue table...maybe all i need is just some errors handling...

the code i'm using (if you need more code just ask :) ) :

/* How many mails could we send each time the script is called */

$max_amount_mails = 10;
$query=mysql_query("SELECT count(*) FROM mail_queue ORDER by id asc");
$num_tosend= mysql_result($query, 0, 0);
$num_mail=ceil($num_tosend/$max_amount_mails);

/* we use the db_options and mail_options from the config again  */

$mail_queue =& new Mail_Queue($db_options, $mail_options);
$mail_queue->setBufferSize(10);

$contaEmailSpeditesi=0;

/* really sending the messages */
for($i=1;$i<=$num_mail;$i++){
$mail_queue->sendMailsInQueue($max_amount_mails,MAILQUEUE_START,1);

sleep(2);
}

thanks !!

2

There are 2 answers

0
cweiske On BEST ANSWER

You should open a bug report in the pear bug tracker.

1
kguest On

You really should filter out the invalid email addresses before adding entries to the mail_queue table - probably not the answer you want though!