Forum Moderators: coopster
Lets say, i have 300 subscribers.
According to my hostings provider mail policy, i can send 200 emails in one hour. So its 18sec/1email.
So what are my possibilities?
1. I can send emails using set_time_limit(0) + sleep(20).
2. Set some cronjob.
Using first method, would force me to have browser window opened for ~1.5h... Not an option.
So i guess using cronjobs would be the best thing to do here.
But how to invoke/destroy cronjobs from a PHP script.
I dont have any shell acc and safe_mode is on :/
Someone please help :-)
Using first method, would force me to have browser window opened for ~1.5h... Not an option.
You can let it run in the background.
Exec [php.net]
Habtom
then have a column in your db that tracks whether the email was already sent
when you want to send a newsletter
set the field to 'no' for all users
turn on your cron
your cron should change the column to 'yes' and then it will only send one to each user and you can turn it off whenever you want. You could even set it to run every 5 mins or more, then if you don't turn it off for a while it won't be running constantly. You could even have it send you an email to tell you it's done.
But as i sad, the safe_mode is on,
and i didnt test exec yet. But lets say
i can use exec, how could i create/destroy cron with exec?
I really dont wont to put cron to run every minute or so,
couse at first ill be havint like 10 subscribers, so basicly
it will just increase server load without any job done...