php mail() problem
Posted: Fri Feb 15, 2008 6:29 am
Hi All,
I am facing strange problem right now in my server. I have php 5 installed with all needed rpms in linux server.
I am using the mail() with following code.
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: email@email.com \r\n";
$headers .= "Bcc: email@email.com \r\n";
$message = "test";
mail("email@email.com","email@email.com",$message,$headers);
Now the message comes in html code. In yahoo mail account the mail is going with html tags applied properly but in gmail and other few mail account, it is going without taking any effect and all tags are just showing.
They are coming like
Content-type: text/html; charset=iso-8859-1
From: email@email.com
<font face=Verdana, Arial, Helvetica, sans-serif size=1><b>test<b></font>
in gmail
but in yahoo it is coming properly,
test
Can anyone help me out of this problem?
Mark.
I am facing strange problem right now in my server. I have php 5 installed with all needed rpms in linux server.
I am using the mail() with following code.
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: email@email.com \r\n";
$headers .= "Bcc: email@email.com \r\n";
$message = "test";
mail("email@email.com","email@email.com",$message,$headers);
Now the message comes in html code. In yahoo mail account the mail is going with html tags applied properly but in gmail and other few mail account, it is going without taking any effect and all tags are just showing.
They are coming like
Content-type: text/html; charset=iso-8859-1
From: email@email.com
<font face=Verdana, Arial, Helvetica, sans-serif size=1><b>test<b></font>
in gmail
but in yahoo it is coming properly,
test
Can anyone help me out of this problem?
Mark.