Page 1 of 1

Emailing Per Hour

Posted: Sun Nov 07, 2004 6:38 pm
by Mr Tech
I have a script that sends out newsletters using the PHPMail class and MySQL. My host only allows me to send out 100 emails per hour...

How would I make the script so that if it has sent 100 messages within the first hour, it waits till the hour is over and then continues for another hour sending out anoi\ther 100 messages. When 100 messages are again sent within the hour it waits until the next hour to continue and so on...

Any ideas?

Thanks

Ben

Posted: Sun Nov 07, 2004 7:05 pm
by PrObLeM
set up a cron job for each hour then have it check to see if a newsletter was sent to the address if not then send

Posted: Sun Nov 07, 2004 7:30 pm
by Mr Tech
So I would need to put limit 100 in the mysql query?

How would be the best way to store whether an email has been sent to a certain email address?

Posted: Sun Nov 07, 2004 7:40 pm
by PrObLeM
like so (im pretty sure)

email_database
id int(12)
email varchar(255)
sent enum('No', 'Yes')

SELECT email FROM email_database WHERE sent='No' LIMIT 0, 100

Posted: Sun Nov 07, 2004 7:43 pm
by Mr Tech
Ok thanks I'll give it a go.