i am facing a weird problem in my php script. i have made a function to send email and calling the function in my php page. the function works fine when i send mail to yahoo or any other domain but fails when it comes to send mail to the gmail account.below is my code
function send_mail($p_to , $p_sub, $p_body)
{
$from = '[email protected]';
$to = $p_to;
$email_subject = $p_sub;
$email_body = $p_body;
$xheaders = "";
$xheaders .= "From: <$from>\n";
$xheaders .= "X-Sender: <$from>\n";
$xheaders .= "X-Mailer: PHP\n"; // mailer
$xheaders .= "X-Priority: 1\n"; //1 Urgent Message, 3 Normal
$xheaders .= "Content-Type:text/html; charset=\"iso-8859-1\"\n";
mail($to,$email_subject,$email_body,$xheaders);
}
// when i send mail directly to a gmail account for example if a create a new page with the above code by taking hardcoded values for all the fields($p_to,$p_subject,$p_body) and sends mail then it works .
it was working fine earlier and sending mails to gmail account but, somehow stopped working for gmail.i checked the spam bucket also but found nothing. any idea frnds ???