Jump to content

delay the sending of email in php


Dude22

Recommended Posts

Hi everyone,

 

I am working on a site, that will allow dentist, doctors and the like to set up automated E-Mail reminders for their clients, instead of having to call them. 

 

I am relatively comfortable in php.  But I have never done anything with E-Mail before...  My main question has to do with sending E-Mail on a specific date.  I have seen a few ways to do it, but nothing that really seems desirable.  One way, seemed to require that someone be using the site, to send the E-mail.  Ie: if an E- mail is supposed to be sent at 6, but no one logs on until 7:30.  Then that E-mail won't be sent until 7:30.   The other method that I have seen used cron, this second method, seems superior but much more complicated.  What method should I use???

 

Any, hits/tips to get me on the right direction would be appreciated!

 

Thanks,

Josh

Link to comment
https://forums.phpfreaks.com/topic/276684-delay-the-sending-of-email-in-php/
Share on other sites

Cron. It's not that complicated really: you add an entry to cron telling it to run a script (from the command line) every once in a while, like every five minutes, and that script does whatever it wants to do. Like process all notifications it should send out at that time.

Cron runs commands at certain times. It's very flexible in how it does so but that's it in a nutshell.

 

Then you just make a PHP script. You can't use web-specific stuff like the REMOTE_ADDR, and the DOCUMENT_ROOT might not be what you expect, but it's all just PHP.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.