Note you must actually have sendmail on your machine (sorry windows NT users).
function send_mail($to_address, $from_address, $subject, $message) {
$path_to_sendmail = "/usr/lib/sendmail";
$fp = popen( "$path_to_sendmail -t", "w");
$num = fputs($fp, "To: $to_address\n");
$num += fputs($fp, "From: $from_address\n");
$num += fputs($fp, "Subject: $subject\n\n");
$num += fputs($fp, "$message");
pclose($fp);
if ($num > 0) {
return 1;
} else {
return 0;
}
}
?>