views:

371

answers:

4

Hello,

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 solution (is this correct?).

A link to get me started or a general outline of what I need to do would be great.

Thanks!

+2  A: 

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.

Sabeen Malik
+3  A: 

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.

John Boker
+3  A: 

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!

Frankie
if you take this approach, be VERY careful that you write your "secret" script to check the last time it was activated and not do anything if 15 days hasn't elapsed. You don't want someone discovering your secret URL and repeatedly requesting it to spam your clients.
rmeador
A: 

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.

Felipe Ribeiro