This question already has an answer here:
Below is header to sent to user:
$to="$mail";
$sub="Thank you!";
$headers = "MIME-Version: 1.0
";
$headers .= "Content-type:text/html; charset=iso-8859-1
";
$headers .= 'From: example.com <noreply@example.com>' . "
";
$msg="Dear $nme ,<br/> We received a request to recover your password.<br/> Your Password is $pss .";
$response =@mail($to,$sub,$msg,$headers);
If i send it through diff sever it goes to inbox. How can I prevent email going to spam?
</div>