I have built a little tool that will send a rich email to all of my customers on my mailing list. The script connects to a database and grabs all of the email addresses then runs a simple loop to send an email.
The script times out when I try to send everyone an email so I added a flag in my .htaccess file that allows scripts a longer time to process (php_value max_execution_time 300). This still seems less than optimal, though.
What is the best way to handle this sort of long repetitive process in a script without timing out or over taxing the server? Do people use some sort of Cron job and have it execute over time or is there a less complicated approach?
I appreciate any advice anyone might have.