Jump to content

if $contact_date == date{ EMAIL ? } ???


shane85

Recommended Posts

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

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.