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.
$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);
That is a basic idea of what you need.
Hope that helps you in the right direction