大家帮忙 html邮件问题 急 求求求 100分 在线等 发HTML邮件的时候,一定要选择Content-Type: text/html;这种格式 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 --$NextPart_1Content-Type: image/gif; name=\"$filename\"改成--$NextPart_1Content-Type: application/octet-stream; name=\"$filename\" 我昨天找了一个收到的也是html源代码<?php/* recipients */$to = "[email protected]" . "," ; // note the comma$to .= "[email protected]";/* subject */$subject = "Birthday Reminders for August";/* message */$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: Mary <[email protected]>, Kelly <[email protected]>\r\n";$headers .= "From: Birthday Reminder <[email protected]>\r\n";$headers .= "Cc: [email protected]\r\n";$headers .= "Bcc: [email protected]\r\n";/* and now mail it */mail($to, $subject, $message, $headers);?> 测试 TYmir(与天为敌) 的代码,能接受到正常的html页面显示网上能找到很多类似的代码,并且一般都能通过测试请注意一点(很重要!):1、邮件头中都是用换行符作为各参数项的分隔的,必须保证数量的正确2、对于“换行符” 运行于win32下的发件服务器需使用"\r\n" 运行于linux下的发件服务器需使用"\n"不能搞错,当测试失败时请先修改之3、对于一些新型的发件服务器,已经没有这个限制了。这也就是同样的代码在不同的发件服务器中表现不一样的原因之一 要按mime格式写才能保证每一个邮箱都正常收到html格式。 xuzuning(唠叨) 谢谢你啊,就是\r\n的问题把这个给疏忽了 请问如何查询包含某字符的所有记录 每篇文章的点击量该如何修改 wamp配置完毕后网页运行显示不全 想学习php+mysql,望前辈指导 写了一个留言本,为什么不显示内容 请教smarty的问题 如何处理半个汉字? 我想用php写一个链表,想了很久都没有写出来,请大家帮帮忙,,, 关闭窗口问题 ______+ 如何生成静态页面??? 求一正则 关于PHP生成略缩图的疑问~(内祥)
Content-Type: image/gif;
name=\"$filename\"改成--$NextPart_1
Content-Type: application/octet-stream;
name=\"$filename\"
/* recipients */
$to = "[email protected]" . "," ; // note the comma
$to .= "[email protected]";/* subject */
$subject = "Birthday Reminders for August";/* message */
$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: Mary <[email protected]>, Kelly <[email protected]>\r\n";
$headers .= "From: Birthday Reminder <[email protected]>\r\n";
$headers .= "Cc: [email protected]\r\n";
$headers .= "Bcc: [email protected]\r\n";/* and now mail it */
mail($to, $subject, $message, $headers);
?>
请注意一点(很重要!):
1、邮件头中都是用换行符作为各参数项的分隔的,必须保证数量的正确
2、对于“换行符”
运行于win32下的发件服务器需使用"\r\n"
运行于linux下的发件服务器需使用"\n"
不能搞错,当测试失败时请先修改之
3、对于一些新型的发件服务器,已经没有这个限制了。这也就是同样的代码在不同的发件服务器中表现不一样的原因之一