// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\r\n";$text = "
<style type=3D'text/css'>
<!--
.style1 {
color: #FF0080;
font-weight: bold;
}
.style2 {color: #FF0080}
-->
</style>
<span class=3D'style1'>ddddddddddddd</span><span class=3D'style2'>dd</span>
";$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
mail("[email protected]","实验",$text,$headers);
$headers = 'MIME-Version: 1.0' . "\r\n";$text = "
<style type=3D'text/css'>
<!--
.style1 {
color: #FF0080;
font-weight: bold;
}
.style2 {color: #FF0080}
-->
</style>
<span class=3D'style1'>ddddddddddddd</span><span class=3D'style2'>dd</span>
";$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
mail("[email protected]","实验",$text,$headers);
解决方案 »
- 易宝支付提示: 抱歉,订单信息丢失,请从商户网站重新提交
- ping“smtp.gmail.com”可以通,为啥PHPMAILer却报错
- 我用smarty输出二维数组,结果页面多了几个数字和“口”。
- 请教关于php5.3.1+连接mssql2000的问题.
- res://ieframe.dll/http_404.htm# 问题
- 关于一个简单的mysql函数检索问题
- 页面跳转的问题
- 菜鸟问题:mysql数据库的表中字段content的值为aaaaa&bbbbb&cccccc&dddddd,我现在想要查找包括 cccccc的记录,语句怎么写?
- PHP分割失败,郁闷啊,苦逼的还在加班调试
- 关于类中方法调用变量$this->一些小问题
- 请教打印的解决方案
- 有必要学smarty吗?我下了个看了挺复杂的
它必须声明发送的内容为html
我也做了实验,但不知道为什么还没成功,期待高手
设置格式,如何设置啊?
$to="[email protected]";//a mail address
$subject="test mail";
$body="<table width='100%' border='1' cellspacing='0' cellpadding='0'>
<tr>
<td>11</td>
<td>12</td>
</tr>
<tr>
<td>21</td>
<td>22</td>
</tr>
</table>";
echo $subject;
echo $from;
$send=mail($to,$subject,stripslashes($body),"From: ".$from."\r\nContent-Type: text/html;charset=\"gb2312\"");
if($send)
echo "send";
else
echo "not send";
?>这个我测试成功
你对照着改下看看,成功了告诉我一下
你在mail()一定要带上上面这第三个参数