error message Notice: Undefined variable: sentmail in /home/stud/1/0472547/public_html/send_password.php on line 59
The code works but when wrong email is entered and it cant find it in the database it comes up with that error its all right but for some reason its saying undefined variable
// ---------------- SEND MAIL FORM ----------------
// send e-mail to ...
$to=$email_to;
// Your subject
$subject="Your password here";
// From
$header="from: your name <your email>";
// Your message
$messages= "Your password for login to Fast Learner \r\n";
$messages.="Your password is $your_password \r\n";
$messages.="more message... \r\n";
// send email
$sentmail = mail($to,$subject,$messages,$header);
}
// else if $count not equal 1
else {
echo "Not found your email in our database";
}
//=============error message is here cant figure it out where it says if ($sentmail){
// if your email succesfully sent
if($sentmail){
echo "Your Password Has Been Sent To Your Email Address.";
}
else {
echo "Cannot send password to your e-mail address";
}
?>