How to throttle a simple emailer script to limit messages sent per hour
Part 2
I'm trying to create a simple custom emailer script that uses class.phpmailer.php to send an html email to client email addresses selected from a database table.
It is basically a SELECT command to retrieve the email addresses and then a WHILE loop that assembles and sends the email. As I do not know how many messages it sends out per hour by default, how do I throttle the sending to make sure it does not go beyond the host's limit? Is the proper way to use a SLEEP command inside the WHILE loop? Something like sleep(10);? I'm having trouble with the while loop sending to only the first record.
I would also like to have some way to test the script without sending any emails, such as echoing the email addresses it would send to once I enable the sending.
Any help would be greatly appreciated. Thanks. :)