shane85 Posted April 6, 2010 Share Posted April 6, 2010 hey guys, I have a field in my db called contact_date....im using strtotime from a user submitted form on when to be contact next, to it adds strtotime+1day +2 day etc etc, so it enters a time stamp in my db. What I want to do is have it so it automatically, without manually executing a script, do pretty much the following if ($arrEntry['contact_next'] == date()) { send email to $arrEntry['representative']; // subject for email here // message for email here The following prospects need to be contacted today: // dunno if need a function to print multiple entrys... put it in anyway function print_prospectEntry($arrEntry) { $arrEntry['company_name']; // show company name $arrEntry['phone']; // show company phone number $arrEntry['email']; // show email address } $prospectEntries = mysql_query('SELECT *, UNIX_TIMESTAMP(tstamp) AS tstamp FROM prospects') or trigger_error(mysql_error()); // Display prospect Entries that are = to the time stamp of today while ($prospectEntry = mysql_fetch_array($prospectEntries)) { print_prospectEntry($prospectEntry); } } Quote Link to comment Share on other sites More sharing options...
leehanken Posted April 6, 2010 Share Posted April 6, 2010 looks like you want to set up a daily cron job on the server that calls a php script, either directly or with lynx maybe the script could use the mail() function Quote Link to comment 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.