[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [kDev] PHP gurus: quick fix coding question...



 
there are also a whole bunch of smtp classes available for php, which are a great deal faster than the inbuilt mail() function - it might be worth trawling around having a look for one.
 
or.. a longer winded method - but quite reliable - is, if the addresses are stored in a database of somesort - fill a temporary table with those addresses, and each time the mail is sent, remove the row from the temporary table. that way, you can get the script to call itself after n rows until the table is empty - and you won't get timeout errors.
 
m
 
----- Original Message -----
Sent: Monday, May 19, 2003 10:44 AM
Subject: Re: [kDev] PHP gurus: quick fix coding question...

@set_time_limit (0);
@ignore_user_abort(true);

The script will not timeout (except in some cases where the script runs
overnight - then it stops at midnight for some reason...)



On Mon, 2003-05-19 at 09:53, Daniel Harris wrote:
> WARNING: This email is intended for PHP coders only...
>
> This question is about how to run PHP code without having to call a web 
> page whilst passing it arguments like a perl cgi script.
>
> When I send out the newsletter I currently use zspamall.php. It allows 
> me to select a group of Kendra Participants and then cycles through 
> them sending a personalised email to each. But as the list of 
> participants grows so does the risk of a page timeout. It seems like 
> it's the sending-of-the-email that introduces a sizeable delay. I need 
> a quick and dirty fix. See:
>
> http://www.kendra.org.uk/develop-
> code.php?page=%2Fzspamall.php&dowhat=Show+Source
>
> All I want to do is replace the line:
>
> mail($email,$subject,$message,"From: kendraNews <k@xxxxxxxxxxxxx>");
>
> with a call to a script.
>
> Oh, no, just thought... Will zspamall.php wait for a return from the 
> cgi script? In which case nothing will be gained and we'll need to put 
> the whole loop into the cgi script.
>
> Ideas anyone? Code anyone?
>
> Cheers Daniel
>
>