FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=18306&edit=1

ID: 18306
Updated by: till@php.net
Reported By: il_pasqui at yahoo dot it
Summary: PEAR Mail_Queue stops on recipient bad syntax
-Status: Open
+Status: Bogus
Type: Bug
Package: Mail_Queue
Operating System: Apache/2.2.15 (Fedora)
Package Version: Unknown
PHP Version: Irrelevant
Roadmap Versions:
New Comment:

-Status: Open
+Status: Bogus
Replace this line in your script:
$mail_queue->sendMailsInQueue($max_amount_mails,MAILQUEUE_START,1);

With:

$status =
$mail_queue->sendMailsInQueue($max_amount_mails,MAILQUEUE_START,1);
if (Pear::isError($status)) {
echo $status->getMessage();
exit;
}


Previous Comments:
------------------------------------------------------------------------

[2011-02-24 14:03:45] il_pasqui

Description:
------------
i'm using PEAR Mail_Queue, everything works great, except when i'm
trying to send emails to "bad" recipients (bad syntax like
"òla@test.com", "uuu@test,com" , "test@test.com.com")

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

Test script:
---------------
/* 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);
}


Expected result:
----------------
jumping to the next row, deleting (or not) the wrong mail in the queue
table

Actual result:
--------------
no errors thrown, the queue stops right after the wrong mail

------------------------------------------------------------------------

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedMar 11, '11 at 5:02p
activeMar 11, '11 at 5:02p
posts1
users1
websitepear.php.net

1 user in discussion

Till: 1 post

People

Translate

site design / logo © 2022 Grokbase