Forum Moderators: coopster

Message Too Old, No Replies

cron job for email newsletter?

cron job for email newsletter?

         

drooh

1:02 am on Jan 15, 2008 (gmt 0)

10+ Year Member



I have a database (mysql) of email subscribers. I want to send a newlsetter to these people over the course of several hours (not all at once).

Right now I am using javascript to count 60 seconds and then refresh thus paging to the next person to email. I know this is not the best way to do this as the browser has to stay open.

From what I can gather I may need to use a cron job, however I have some questions.

Is this cron job always running? How would I click a button to send my nesletter and it cycle through the emails sending 1 per 60 seconds and then stopping when done?

Its as if I want to use php to set up the cron job and then also use php to tell it when to stop. Is this possible? Im stil trying to understand how cron jobs work.

Any help or examples would be much appreciated.

phparion

7:40 am on Jan 15, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



To run one time cronjob you need to use AT or BATCH commands. You can use shell_exec() kind of functions with PHP to do this.

study this for AT and Batch usage [kb.indiana.edu]