my php mails ie confirmation mail always go in spam folder, but when i mark hat mail as NOT SPAM, php confirmation mail never comes in inbox or in spam. What to do, please help
What I have tried:
$to = $email;
$subject = "Verify your account ";
$body = "Dear $name
$header = "From:admin@xyz.com \r\n";
//$header .= "Cc:afgh@somedomain.com \r\n";
$header .= "MIME-Version: 1.0\r\n";
$header .= "Content-type: text/html\r\n";
$retval = mail ($to,$subject,$body,$header);
if( $retval == true ) {
header("location:verify.php");
}else {
echo "Message could not be sent...";
}
//echo "
Details Saved!
";
}
}
else
{
echo 'Error' . mysqli_error($conn);
}
}