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); } } Link to comment https://forums.phpfreaks.com/topic/197772-if-contact_date-date-email/ 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 Link to comment https://forums.phpfreaks.com/topic/197772-if-contact_date-date-email/#findComment-1037966 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.