php mail function says Email sent but it dosent
<p>im using this code and it prints out sent but im not reciving any email
i have sat that on my local server configured the mail function and everything is correct 
but still not working</p>

<pre><code>$to = "xxxx@yahoo.com";
$subject = "$name";
$txt = "$msg";
$headers = "From: xxxx@gmail.com";
if (mail($to,$subject,$txt, $headers)){
    echo "sent";
}else{
    echo "error";
}
</code></pre>

<p>it keeps sayin that Sent but im not getting any email </p>
