开发者

How to send schedule emails using php without cron job

开发者 https://www.devze.com 2023-01-24 03:21 出处:网络
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.

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


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消