我收到这种形式的电子邮件:
"<span style="color:red;"> blablabla text goes here </span>"
代替
"blablabla text goes here"
红色的。任何类型的 html 都作为代码发送出去......关于如何解决这个问题的任何想法?提前致谢
if(isset($_REQUEST['Message']) && $_REQUEST['Message']!="")
{
$header="From: ".$_REQUEST['FromName']."<".$_REQUEST['FromEmail'].">\r\n" .
'X-Mailer: PHP/' . phpversion() . "\r\n" .
"MIME-Version: 1.0\r\n" .
"Content-Type: text/html; charset=iso-8859-1" . "\r\n".
"Content-Transfer-Encoding: 8bit\r\n\r\n";
$to=explode(",",$_REQUEST['Recipients']);
for($i=0;$i<count($to);$i++)
{
$x=explode("<",$to[$i]);
$x=explode(" ",$x[0]);
$firstname=$x[0];
mail($to[$i],$_REQUEST['Subject'],str_replace("\$firstname",$firstname,$_REQUEST['Message']),$header);
//
}