How can I send an auto-generated email every x-days with php mail(), without access to cron?
I am trying to send an email, via php's mail function to user's every 15 days to remind them of a particular item (no worries, nothing spam related). I unfortunately do not have access to cron, so I think I would need some sort of client side sol开发者_开发技巧ution (is this correct?).
A link to get me started or a general outline of what I need to do would be great.
Thanks!
You would definitely need something that triggers this process on the interval you want, you might want to try something like http://www.webbasedcron.com/ then have a page that you can hit that sends out the emails.
Like said before you need a trigger.
That said, why not make a secret url the shoots the mail say:
http://mysite.com/secret/fireemailreport.php
And have a site like Pingdom do a scan on that every couple of days? Pingdom would fire a server response and your email would be sent. On top of that, if your email could not be sent (because your server was down), Pingdom would contact you!
Hope it helps!
EDIT: Check out the great comment by meador!
U need a trigger and without cron you dont have a trigger.. unless ur site is reasonably high traffic and ur getting a hit on some page every minute or so .. if you have that kinda traffic .. you might use the page hit as a trigger and schedule mail sending according to that.
If you can't use cron, but can access the command line, you can create a deamon that runs an infinite loop checking the time and going to sleep, and when it's the right time it sends the message. You can use PHP-CLI for it, but cron seems much more appropriate.
精彩评论