为什么Mail会在垃圾邮件中收到? [关闭]

I have the following code which sent the mail as spam .Please help me how to receive main not as spam

     <?php 


    $title=$_POST['title'];
    $fname=$_POST['fname'];
    $lname=$_POST['lname'];
    $email=$_POST['email'];
    $to = "narayan_alz@hotmail.com";
   $subject = "This is a Registration Message For Plasma Seminar";
    $message = "Title=$title    First Name=$fname    Last Name=$lname ";
  $header = "from:$email";
   $retval = mail($to,$subject,$message,$header);

?>

Its not the code, its the server,

Whitelist your ip at http://www.spamhaus.org/ and other similar sites.

Lookup for your ip here, http://www.spamhaus.org/lookup/

Your email is not sent as spam, but the spam filter that hotmail uses registers your email as spam. There is no way to prevent this from your PHP code apart from making emails that people don't flag as spam.

What you can do in hotmail is add the sender email address to your address book (recommended) or disable the spam filter (not recommended)

Getting your mail NOT marked as spam is an art itself. You'll probably want to check the following:

1) Make sure your mail server is not an open relay.

2) Make sure reverse DNS and PTR records are correct. If this is wrong, there is already a big chance your mail will be marked as spam.

3) Implement Sender Policy Framework (SPF)

4) Implement DKIM

make sure the hostname listed in the SMTP HELO banner matches your hostname

In this case (hotmail) you'll need to apply to get your server IP address white listed.

https://support.live.com/eform.aspx?productKey=edfsmsbl3&ct=eformts&scrx=1