|
Posted by Roger Dodger on 04/05/06 02:13
Jerry Stuckle wrote:
> Satya wrote:
> > What about writing a script such way that it send like 1000 mail and
> > sleep for 1 sec and start again
> >
>
> sleep() doesn't reset the timeout clock, so this doesn't work. In fact, since
> you're sleeping during part of your total allowed time, you'll get even less done.
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstucklex@attglobal.net
> ==================
So I went with the suggestion to use set_time_limit(0) at the top of
the script. That works just fine. I can send 2500 e-mails plus bcc
each one to a separate account in 4-6 minutes. To insure that there is
some record of what has been sent if the program were to crash, I open
a log file before the main loop, and record a success or error message
in the if (! $mail->send() ) { } else { } clause. It works great!
I've also managed to embed images in the mails as well, so if you are
looking for a mass mailer, I highly recommend the open source PHPmailer
class.
Navigation:
[Reply to this message]
|