travelerBT Posted May 14, 2007 Share Posted May 14, 2007 Ok... here is what I am trying to do. I have a site that allows users to post events in certain states. When this happens, I want to send an email to every other user in that state to inform them of the posting, and allow them to sign up for that event. I want to have some back end software that sends the email to everyone in that state behind the scenes, so that the user doesn't have to wait for the script to send on the front end. I guess I need to know if this is something that can be done in PHP? And if not, how I can do this. I am running on the LAMP environment. thanks ya'll! ??? Quote Link to comment https://forums.phpfreaks.com/topic/51381-backend-email-script/ Share on other sites More sharing options...
veridicus Posted May 14, 2007 Share Posted May 14, 2007 I handle this type of thing with a separate PHP script running from cron. I write scripts that query for the people I want to email, call the mail command as needed, flag those people as emailed in the database, and then close without outputting anything (except errors to a log). I then call that from a cron with "php -f filename.php". Quote Link to comment https://forums.phpfreaks.com/topic/51381-backend-email-script/#findComment-253003 Share on other sites More sharing options...
travelerBT Posted May 14, 2007 Author Share Posted May 14, 2007 sweet... anyway I could get an example of these script? How to set it up? I am not familiar with the cron feature. thanks Quote Link to comment https://forums.phpfreaks.com/topic/51381-backend-email-script/#findComment-253022 Share on other sites More sharing options...
travelerBT Posted May 14, 2007 Author Share Posted May 14, 2007 correction, I don't need the php script... got that nailed down, what I need is how to set up a cron job using PHP... thanks again Quote Link to comment https://forums.phpfreaks.com/topic/51381-backend-email-script/#findComment-253033 Share on other sites More sharing options...
veridicus Posted May 15, 2007 Share Posted May 15, 2007 cron will run anything set up properly in the /etc/crontab file (see man pages or wikipedia for details). The command you want to run is "/path/to/php -f your_script.php". Quote Link to comment https://forums.phpfreaks.com/topic/51381-backend-email-script/#findComment-253646 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.