php coding for duedate alert system

Hello,

i’m newbie in php. I would like to ask how to start writing php command in order to send due date alert via email. i’m successfully connect php with google smtp. the situation is like this. i would like to send notification to the user if the user is not return back the vessel to the laboratory before 5pm on the same day.

You would need somewhere to store the info from whomever has borrowed an item. (either database or text file etc)

Once you are setup to accept values - IE 1=outstanding 2=returned etc etc…

simply check the values and send mail to whomever has a value of 1.
IE
[php]
$subject = “blah blah blah”; // set the subject
$message = “foo bar foo bar foo bar”; // set the message
$from = "[email protected]"; // set the from address

// make a query
$query = mysql_query(“SELECT email_address FROM database WHERE item=1”);
// loop through each user
while($row = mysql_fetch_array($query, MYSQL_ASSOC))
{
// send an email.
mail($row[‘email_address’], $subject, $message, $from);
}
[/php]

That is a basic idea of what you need.

Hope that helps you in the right direction
:wink:

Sponsor our Newsletter | Privacy Policy | Terms of Service