
Originally Posted by
xPlozion
off topic, but may help you. I have a cron script in php that makes i think about 200 calls to different pages (don't worry, it's in the wee hours in the morning, one day a week, just to synchronise data). Maybe cronjobs are not affected by server timeouts, or i'm using it a different way... idk tbh...
CRON jobs are definitely not affected by server timeouts, it's only when PHP scripts are parsed through the Apache server that they have a timeout (set in php.ini, default is 30 seconds).
Therefore, you can set up a CRON job to run your PHP script outside of Apache (i.e. in the command-line). Alternatively, you can implode an array of email addresses and send it all at once (here's a snippet of some of my old code):
PHP Code:
$emails = implode (", ", $email_array);
$headers = "MIME-Version: 1.0"."\r\n".
"Content-type: text/html; charset=iso-8859-1"."\r\n".
"From: email@youserver.com"."\r\n".
"Reply-To: email@youserver.com"."\r\n".
"X-Mailer: PHP/".phpversion();
$subject = "Testing email";
$body = "whatever you want to put here (even HTML, as specified in Content-type)";
mail($emails, $subject, $body, $headers);
the only problem is that this might be filtered as SPAM, but if you tell your users to add "email@youserver.com" to the "safe senders" (or whatever their email clients call it) you should be OK