it always goes to echo "failed;" and print error:
Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\xampp\htdocs\login_test\forgotpassword.php on line 49
failed
$to = $email;
$subject = "Forgot password";
$message = "Hi $firstname_db,\n Your password is $password_db";
$headers = "from: text@hotmail.com";
if(mail($to, $subject, $message, $headers)) //lline 49
{
echo "message successfully sent";
}
else
{
echo "failed";
}