Re: sendmail loop

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

 



On 4/13/07, John Pillion <john@xxxxxxxxxxx> wrote:
I have a sendmail script that loops through an array of email addresses. the
problem is, the list can sometimes be fairly long, and the page does not
finish loading until the loop has completed.  Currently, I have the majority
of the page loading, including text that says "messages sending, please
wait.", with a "completed" message after the loop.  Though that gives an
appearance of working (and lets the patient user know what is going on), if
the user leaves the page, or the page times out before the loop has
finished, not all the emails will be sent.



Is there a way to trigger a script to run on the server (in the background)?



I had the thought to save the notice to the DB, and then have a cron check
every few minutes to send it, but that could be too much load on the
servers.  Any other alternatives?



Thanks!



~J
With set_time_limit you could set the timeout value higer:
http://www.php.net/set_time_limit
So that your script won't timeout when it takes too long.
Also, when the user closes his browser, the script will continue!

Tijnema



Ps.  No, this is not a spam application - it is a notice/announcement form
for directors/administrators of an organization



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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux