php mail() function not working with gmail
<p>PFB my code </p>

<pre><code>&lt;html&gt;
    &lt;head&gt;
        &lt;title&gt; Your information&lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;
    &lt;?php

    $x = $_POST['yourname'];


    $email = $_POST['email'];
    $msg="Your Name is $x.";
    $to='abc@gmail.com';
    $sub='Your information';
    $header = "From: ". $x . " &lt;" . $email . "&gt;\r\n";
    ini_set("SMTP","smtp.gmail.com" );
    ini_set('sendmail_from', 'abc@gmail.com');
    //$email is entered as abc@gmail.com
    if(mail($to, $sub, $msg,'From:' . $email)){
        echo 'success';
    }
    else{
        echo 'failure';
    }


echo 'Thanks for submitting your information&lt;br/&gt;';
echo 'Your Name ' . $x . '&lt;br/&gt;' ;
echo 'Email ' . $email . '&lt;br/&gt;' ;
echo $msg;
?&gt;
    &lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>i hqve configured my outlook 2007 with my gmail account(POP/SMTP). 
and the php.ini settings are SMTP= smtp.gmail.com
smtp_port= 587. These settings also match with the outlook settings.</p>

<p>Still all i get is "failure" prinited on my browser.
Please help.</p>
