【问题标题】:PEAR Mail_Queue stops on recipient bad syntaxPEAR Mail_Queue 在收件人语法错误时停止
【发布时间】:2011-07-02 15:44:20
【问题描述】:

我正在使用 PEAR Mail_Queue,一切正常,除非我尝试发送电子邮件到 “坏”收件人(坏语法,如“òla@test.com”、“uuu@test,com”、“test@test.com.com”)

当队列发现错误的收件人时,它会停止,将所有其他邮件留在 db 队列表中...

我只想让它跳转到下一封邮件,删除(或不删除)队列表中的坏邮件...也许我需要的只是一些错误处理...

我正在使用的代码(如果您需要更多代码,请询问:)):

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

谢谢!!

【问题讨论】:

    标签: php pear mail-queue


    【解决方案1】:

    您应该在 pear 错误跟踪器中打开错误报告。

    【讨论】:

      【解决方案2】:

      在将条目添加到 mail_queue 表之前,您确实应该过滤掉无效的电子邮件地址 - 但可能不是您想要的答案!

      【讨论】:

      • 是的,已经解决了这个问题,这只是一个问题,为什么(否则很好)类不能解决这样的常见问题......
      猜你喜欢
      • 2011-04-10
      • 2020-01-08
      • 1970-01-01
      • 2012-02-11
      • 2010-10-06
      • 2013-02-01
      • 1970-01-01
      • 2012-05-14
      • 2013-03-03
      相关资源
      最近更新 更多