css transform scalez:在php中使用mail函数发送邮件,为什么收到的邮件并没有显示mail函数中规定的html语言要表达的格式?

来源:百度文库 编辑:神马品牌网 时间:2024/05/05 01:16:08
我的代码如下:
<?php
$name="emily";
$gender="girl";
$toaddress="czemily@gmail.com";
$subject='ok';

$message = '
<html>
<head>
<title>Birthday Reminders for August</title>
</head>
<body>
<p>Here are the birthdays upcoming in August!</p>
<table>
<tr>
<th>Person</th><th>Day</th><th>Month</th><th>Year</th>
</tr>
<tr>
<td>Joe</td><td>3rd</td><td>August</td><td>1970</td>
</tr>
<tr>
<td>Sally</td><td>17th</td><td>August</td><td>1973</td>
</tr>
</table>
</body>
</html>
';

/* To send HTML mail, you can set the Content-type header. */
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";

/* additional headers */
$headers .= "To: Emily <czemily@gmail.com>\r\n";
$headers .= "From: Chenli <chenli91326@e163.com>\r\n";
$headers .= "Cc: chenli91326@e163.com\r\n";
$headers .= "Bcc: chenli91326@e163.com\r\n";

/* and now mail it */
mail($toaddress, $subject, $message, $headers);

?>
收到的信件中还是html标记语言,并没有相应的显示格式。不知道是为什么?请各位帮帮忙哦

10月7日 18:41 出现这种问题的可能原因有2:

sock_mail中的$from所指明的发件地址和$smtp_acc所声明的用户名不一致。将他们改成一致的就可以了。
function.php中的qp_mail函数拼接邮件头($headers)的时候只使用了“\n”,按照phpbt的开发论坛以及目前正在开发的1.0版本中的说法,应该使用“\r\n”,因此如果发送邮件不成功,可以考虑将qp_mail函数中的“\n”替换成“\r\n”(共三处)。如果发送邮件没有问题,则可以忽略此步骤。