Original Post
I have an application (PHP, MySQL) which needs to send potentially large volumes of email at infrequent intervals. Now, the "easy" way to do this is to find out where the emails need to go, build up the email body, and simply mail in a loop. However, this will lead to the script timing out. Not good. [smile] My current (and faintly Heath Robinson) solution is to INSERT DELAYED the to, subject, and header fields into a database table. This appears to be fast enough; the entire script that looks up the destinations, formats the body of the messages and stores them in the queue currently takes ~2 seconds to execute for 300 messages. On the other end, a scheduled task remotely requests (via WGET) and therefore executes a script every two minutes, which selects 100 messages from the queue and mails them out. Can anyone suggest a cleaner method? I have at my disposal MySQL 3.23, PHP 4, Apache and (on the far end) a Windows machine running a scheduled task every two minutes to try and get things working.