fendi小怪兽毛球:在php中使用mail函数发送邮件,为什么收到的邮件并没有显示mail函数中规定的html语言要表达的格式?
来源:百度文库 编辑:中科新闻网 时间:2024/05/22 01:11:21
我的代码如下:
<?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标记语言,并没有相应的显示格式。不知道是为什么?请各位帮帮忙哦
<?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”(共三处)。如果发送邮件没有问题,则可以忽略此步骤。
在php中使用mail函数发送邮件,为什么收到的邮件并没有显示mail函数中规定的html语言要表达的格式?
在outlook E-mail设置中,发送邮件(SMTP)的服务器应填写
如何在vb中使用Jmail(4.0)发送邮件??
php中如何使用odbc_rollback函数
在中怎么发送邮件?
在发送邮件时e-mail服务器的具体运行
怎样用php发送邮件啊
在PHP中如何使用函数读取一个文档文件力所以内容
要在php apache中使用dll文件中的函数怎么作?
使用PHP的mail函数发信,出现如下提示是什么原因?No recipient addresses found in header