0

I want send schedule mails using my php website, I don't want to use cron job because shared hosting environments might not provide all the functions.

So how can I send schedule mails with my site. Please let me know.

Thanks in advance, Laxmilal Menaria

bcosca
  • 17,371
  • 5
  • 40
  • 51
Laxmi Lal Menaria
  • 1,433
  • 4
  • 17
  • 30

2 Answers2

2

Check out:

http://www.onlinecronjobs.com/

The purpose of this website is to allow website administrators without cronjob service on their own host, run cronjobs.

It claims to be free service although I haven't tried it.

Sarfraz
  • 377,238
  • 77
  • 533
  • 578
2

You can send emails using visitor hits. Write somewhere (db) the last time you runned job.

$now = time();
if ($now > $last_sent_time + 3600) {
  // code that sends emails
  // goes here ....... 

  set_last_sent_time($now);
}

I think you got the idea. You should put this code on every request to site. The example sends emails every hour.

galymzhan
  • 5,505
  • 2
  • 29
  • 45
  • 2
    "The example sends emails every hour." So long as you have visitors often enough. If you only get 2 visitors a day, obviously you'd only get emails being sent twice a day. You'll also need to store the last_sent_time in a database or file to read later. This is really your only option though. – Blair McMillan Nov 08 '10 at 09:14
  • Totally correct. But you can configure cron on your home (or whatever) computer, which will send http request to your site every hour (launch a browser and navigate to your site). – galymzhan Nov 08 '10 at 13:40