Re: mail queue configuration help

From: Date: Wed, 14 Jan 2004 21:44:23 +0000
Subject: Re: mail queue configuration help
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-10162@lists.php.net to get a copy of this message
LORENZO. Thank you for the suggestion, and I suppose it is easy enough to do it that way. But it begs the question: Why doesn't it work within one script? thanks: STEPHEN. ] stephen@musgrave.org ] http://stephen.musgrave.org/ On 1/14/04 12:38 PM, "Lorenzo Alberton" <l.alberton@quipo.it> wrote: > On Wed, 14 Jan 2004 12:24:31 -0500, Stephen Musgrave wrote: >> i am using MAIL_QUEUE for the first time and i've run into >> something that has me scratching my head. >> >> i set up a test php script that when invoked build one email >> message, puts it in the queue and then starts the queue. >> >> the email is successfully placed in the database but it is not sent >> when the code to start the queue is called. >> >> so, with that one email in the database, i invoke the script again. >> this second email is put in the database and the 1st email is sent >> (but the 2nd one is still in the database). >> >> it feels as if the the sendMailsInQueue is called before the put >> command is called, but my code doesn't read this way. or there is >> a delay between when i put the mail in the queue and when i can >> send? (i have $seconds_to_send set to 0.) > > > I suggest you put the "put mail in the db" and the "send mails in the db" > code in two different scripts. Please look at the Mail/Queue.php source > to see an usage example. > > the first part is the same for storing AND sending the emails, > then you have to write one of the following sections, depending > on what you want to do: > > ***************************************************************** > * // TO ADD AN EMAIL TO THE QUEUE > * ***************************************************************** > (LINES 60-85) > > > OR > > * ***************************************************************** > * // TO SEND EMAILS IN THE QUEUE > * ***************************************************************** > (LINES 86-94) > > > HTH > Lorenzo > > >

« previous php.pear.general (#10162) next »