brian wrote:
> Richard Kurth wrote:
>> I want to limit these script two send 100 email and then pause for a
>> few seconds and then send another 100 emails and repeat this tell it
>> has sent all the emails that are dated for today. This script is runs
>> by cron so it is running in the background.
>>
>> How would I do this and is it the best way to do it. I am using swift
>> mailer to send the mail.
>>
>> I think I would use limit 100 in the query but how would I tell it to
>> get the next 100.
> 
> There's no need to limit the DB query, nor to track what's been sent by
> updating the DB. Grab all of the addresses at once and let SwiftMailer
> deal with the throttling:

Of course there is.

1) What if the server gets rebooted in the middle of the send or the
database goes down in the middle? You send to everyone again.

2) What if the host has a limit on how long a script can run for? You
send to everyone again and again and again each time the script tries to
start.

3) What if safe-mode is enabled on the server? You have a limited send
time and possibly end up with the same outcome as #2.

4) What if you are sending to 100,000 email addresses? You run out of
memory because you have so much data loaded.

-- 
Postgresql & php tutorials
http://www.designmagick.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to