嗨,在我的代码中,一切都是正确的,如查询和显示条件,但发送邮件的邮件是邮件不发送。
问题是什么,请找出..!邮件不发送所有验证是正确的为什么它所以请找到它只有邮件不工作或任何问题像标题你能告诉我标题已经改变。
<?php
include '../includes/config.php';
if(isset($_POST['submit']))
{
$mail=$_POST['email'];
$sql= "select * from users where email= '$mail' ";
$res = $conn->query($sql);
$num = mysqli_num_rows($res);
if($num!==0)
{
$rows = $res->fetch_array();
$to=$rows['email'];
$subject="Remind password";
$message ="Your password : ".$rows['encrypted_password'];
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
$headers .= 'From: <purendergoud@gmail.com>' . "\r\n";
$headers .= 'Cc: myboss@example.com' . "\r\n";
/* $headers = 'From: purendergoud@gmail.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();*/
if(mail($to,$subject,$message,$headers)){
echo "Message sent successfully...";
echo'Check your inbox in mail';
echo "<script>alert('your password sent to your mail');
window.location('login.php');
</script>;";
}
else
{
echo'mail is not send';
}
}
else
{
echo'You entered mail id is not present';
}
}
?>