php mail send issue
<p>I've a php code below to send data from a form to my gmail account. It's working fine if the the user's mail id is gmail. But it's not working if the user account belongs to hotmail, yahoo etc. That is when user filling the form I'm requesting their mail id also. If their mail ID hotmail or yahoo the form data is not getting to my gmail account. Any idea about this would be really helpful. </p>

<pre><code>&lt;?php 
session_start();
$cap = 'notEq';

if($_SERVER['REQUEST_METHOD'] == "POST") {

    //echo ($_POST['captcha']);
    //echo ($_SESSION['cap_code']);

    if ($_POST['code'] == $_SESSION['cap_code']) {

    //echo ('auxxwkasl');

            // multiple recipients
            //$to  = 'abhilashkk@gmail.com';
            $to  = 'abhilashkk@gmail.com';
            $subject = 'You have a General Enquiry';
            $headers = "From: " .$_POST['email'] . "\r\n";
            $headers .= "Reply-To: ".$_POST['Email'] . "\r\n";
            $headers .= "MIME-Version: 1.0\r\n";
            $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";


            $message = '&lt;html&gt;&lt;body&gt;';
            $message .= '&lt;h1 style="color:#BF0404;"&gt;You have an enquiry&lt;/h1&gt;';
            $message .= '&lt;table rules="all" style="border-color: #666;" cellpadding="10" width="100%"&gt;';

            $message .= "&lt;tr style='background: #eee;'&gt;&lt;td&gt;&lt;strong&gt;Name:&lt;/strong&gt; &lt;/td&gt;&lt;td&gt;" .$_POST['name']."&lt;/td&gt;&lt;/tr&gt;";


            $message .= "&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Mobile:&lt;/strong&gt; &lt;/td&gt;&lt;td&gt;" .$_POST['mobile']. "&lt;/td&gt;&lt;/tr&gt;";


            $message .= "&lt;tr  style='background: #eee;'&gt;&lt;td&gt;&lt;strong&gt;Email:&lt;/strong&gt; &lt;/td&gt;&lt;td&gt;" .$_POST['email']. "&lt;/td&gt;&lt;/tr&gt;";

            $message .= "&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Comments:&lt;/strong&gt; &lt;/td&gt;&lt;td&gt;" .$_POST['comments']. "&lt;/td&gt;&lt;/tr&gt;";


            $message .= "&lt;/table&gt;";

            $message .= "&lt;/body&gt;&lt;/html&gt;";



            $sent = mail($to, $subject, $message, $headers);
            echo ($sent);
            $cap = 'Eq';

            $message = "Your enquiry has been sent! We'll get back to you soon. Thank you.";
            $confirm=1;


            } else {

             $cap = '';
             $confirm=0;
            $message = "Please verify that you typed in the correct code.";
}
}
?&gt;
</code></pre>
