Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.2.7

Bug #12521 Mail_Queue not sending mail
Submitted: 2007-11-24 23:47 UTC
From: jcwalpole Assigned: till
Status: Closed Package: Mail_Queue (version 1.2.1)
PHP Version: 5.1.6 OS: LINUX fedora core 2
Roadmaps: (Not assigned)    
Subscription  


 [2007-11-24 23:47 UTC] jcwalpole (John Walpole Jr.)
Description: ------------ Notice: Undefined index: persist in /var/www/vhosts/sonsdny.org/httpdocs/includes/Mail/Queue.php on line 333 I put an echo 'Emails were sent.' . date('F j, Y H:i'); at the end of the script for cron reporting. The emails stay in the database and I even commented that line out and still no luck. I have the most recent files for Mail, DB, Mail_Queue, Mail_Mime, etc. Test script: --------------- error_reporting(E_ALL); ini_set ('display_errors', '1'); //PHP 5 and > require_once ("Mail/docs/base.php"); // How many mails could we send each time $max_ammount_mails = 200; $offset = 0; $try = 2; $mail_queue =& new Mail_Queue($db_options, $mail_options); $mail_queue->sendMailsInQueue($max_ammount_mails,$offset,$try); http://www.sonsdny.org/php_scripts/sendqm.php Expected result: ---------------- I expect it to send emails.

Comments

 [2007-11-25 13:40 UTC] quipo (Lorenzo Alberton)
I fixed the NOTICE in CVS. Regarding the fact that the emails are not sent, please check your mail settings. Try sending an email with PEAR::Mail and the same settings to see why it's not working.
 [2007-11-26 18:17 UTC] jcwalpole (John Walpole Jr.)
I have tried the Pear Mail package and the mail was sent fine. here is the code from the test. $mail =& Mail::factory('mail'); $mail->send('jwalpolejr@sal1634liny.org', array('From'=>'webmaster@sonsdny.org'),'Testmail'); I recieved the mail with no problem. I have the base.php configured with $db_options['type'] = 'db'; $db_options['dsn'] = 'mysql://user:passwd@localhost/db'; $db_options['mail_table'] = 'mail_queue'; $container_options = array( 'type' => 'db', 'database' => 'detny_sal', 'phptype' => 'mysql', 'username' => 'username', 'password' => 'pswd', 'mail_table' => 'mail_queue' ); $mail_options['driver'] = 'mail'; //mime, smtp, sendmail, mail This does not work.
 [2007-11-26 22:45 UTC] jcwalpole (John Walpole Jr.)
if ($this->mail_options['persist'] && is_object($this->send_mail)) { $this->send_mail->disconnect(); } in sendMailsInQueue() in Queue.php the this->mail_options['persist'] is giving the error. Have tried commenting out and the error goes away but mail stays in mail_queue table.
 [2007-11-30 12:54 UTC] bate (Marco Kaiser)
i take over this bug
 [2008-03-05 11:18 UTC] quipo (Lorenzo Alberton)
Marco, are you active?
 [2008-05-05 08:26 UTC] till (Till Klampaeckel)
Here are some things to look at: In the mail_queue table, what are the values of sent_time, try_sent and delete_after_send. I think I found a bug where when the mail settings fail (via smtp authorization), the sent_time still got set and then caused the email not to be re-send. The queue only selects emails where the sent_time "IS NULL". The quickfix is: UPDATE mail_queue SET sent_time = NULL WHERE sent_time ISNOT NULL AND try_sent > 0 AND delete_after_send = 1 Please check those things and provide feedback, otherwise I am working on a fix and will then close this bug.
 [2008-05-06 20:57 UTC] till (Till Klampaeckel)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better. Both Lorenzo and me have committed additional checks to Queue.php, if you have the means, please try CVS. We'll release shortly. Thanks for your patience and thanks for flying PEAR-Air.