Why mail send as spam message : <p>if you had solution please help me to fix it. please? mail was sent but it always visible on spam message. so how i keep it for inbox. please check my code deeply and give me right answer for matching my code.
i used this point i create user login part and i want to give user to recovery option. then user will try to recovery i will send user to mail.</p>

<pre><code>&lt;?php
            session_start();
             mysql_connect(***, ****, ***);
              mysql_select_db('*****');
              $email = $_POST["email"]; 
              $_SESSION["email_id"]=$email;
              $a = rand(100,999999);
               //echo $a;
                $_SESSION["random"]=$a;
             $to = $email;
             $subject = "Verification Code";
             $message = 
                            "&lt;!DOCTYPE html&gt;
                            &lt;html&gt;
                                &lt;head&gt;
                                    &lt;title&gt;&lt;/title&gt;
                                &lt;/head&gt;
                                &lt;body&gt;
                                    &lt;h2 style='color:#000CA5;'&gt;Your Verification code is : &lt;/h2&gt;&lt;br&gt;&lt;h2&gt;&lt;b&gt;$a&lt;/b&gt;&lt;/h2&gt;
                                &lt;/body&gt;
                            &lt;/html&gt;";
             $header = "From:****@**.com \r\n";
             $header .= "MIME-Version: 1.0\r\n";
             $header .= "Content-type: text/html;charset=UTF-8" . "\r\n";
             $retval = mail ($to,$subject,$message,$header);
             if( $retval == true ) {
               // echo "Message sent successfully...";
                $sql = "update random set ran_num='$a' where emailid='$email'";
                mysql_query($sql);
                IF(!mysql_query($sql)){
                die("erroe processing :".mysql_error());
            }
            else{
                echo "&lt;script language='javascript' type='text/javascript'&gt; location.href='password_update.php' 
                &lt;/script&gt;";
            }  
             }
          ?&gt;
</code></pre>
