如何用php中的mail函数使信件以html格式发出??高手指点!!! 楼上的大哥!你搞笑呀……nl2br只对\n才有用…… 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 不好意思,写错了,用htmlspecialchars(); 文本格式的邮件:mail("[email protected]", "My Subject", "Line 1\nLine 2\nLine 3");HTML格式的邮件:/* recipients */$recipient .= "Mary <[email protected]>" . ", " ; //note the comma$recipient .= "Kelly <[email protected]>" . ", ";$recipient .= "[email protected]";/* subject */$subject = "Birthday Reminders for August";/* message */$message .= "The following email includes a formatted ASCII table\n";$message .= "Day \t\tMonth \t\tYear\n";$message .= "3rd \t\tAug \t\t1970\n";$message .= "17rd\t\tAug \t\t1973\n";/* you can add a stock signature */$message .= "--\r\n"; //Signature delimiter$message .= "Birthday reminder copylefted by public domain";/* additional header pieces for errors, From cc's, bcc's, etc */$headers .= "From: Birthday Reminder <[email protected]>\n";$headers .= "X-Sender: <[email protected]>\n";$headers .= "X-Mailer: PHP\n"; // mailer$headers .= "X-Priority: 1\n"; // Urgent message!$headers .= "Return-Path: <[email protected]>\n"; // Return path for errors//此处就是与文本邮件不同的地方/* If you want to send html mail, uncomment the following line */$headers .= "Content-Type: text/html; charset=iso-8859-1\n"; // Mime type$headers .= "cc: [email protected]\n"; // CC to$headers .= "bcc: [email protected], [email protected]"; // BCCs to/* and now mail it */mail($recipient, $subject, $message, $headers);//摘自PHP MANUAL E文班 有关循环的问题 一个小问题,大家来看看 读出数据的问题 asp网站如何与php论坛整合? 求一段在smarty下好用的幻灯片代码 关于全文索引,普通索引和无索引,在中文和英文上;做了一组测试,但结果很让人迷茫;请高手指点! 求问下这个 Call to undefined function int()的原因 哪位知道沈阳PHP程序员试用期,转正之后大约多少钱呢? 淘宝api签名请求参数q查询中文出错 PHP如何写一个自动记录访客日志的脚本? 关于数据库里图象的输入和输出的问题 为什么我下载的apache_1.3.19 for win32 没有安装程序啊?一个.exe的文件都没有
mail("[email protected]", "My Subject", "Line 1\nLine 2\nLine 3");
HTML格式的邮件:
/* recipients */
$recipient .= "Mary <[email protected]>" . ", " ; //note the comma
$recipient .= "Kelly <[email protected]>" . ", ";
$recipient .= "[email protected]";/* subject */
$subject = "Birthday Reminders for August";/* message */
$message .= "The following email includes a formatted ASCII table\n";
$message .= "Day \t\tMonth \t\tYear\n";
$message .= "3rd \t\tAug \t\t1970\n";
$message .= "17rd\t\tAug \t\t1973\n";/* you can add a stock signature */
$message .= "--\r\n"; //Signature delimiter
$message .= "Birthday reminder copylefted by public domain";/* additional header pieces for errors, From cc's, bcc's, etc */$headers .= "From: Birthday Reminder <[email protected]>\n";
$headers .= "X-Sender: <[email protected]>\n";
$headers .= "X-Mailer: PHP\n"; // mailer
$headers .= "X-Priority: 1\n"; // Urgent message!
$headers .= "Return-Path: <[email protected]>\n"; // Return path for errors//此处就是与文本邮件不同的地方
/* If you want to send html mail, uncomment the following line */
$headers .= "Content-Type: text/html; charset=iso-8859-1\n"; // Mime type$headers .= "cc: [email protected]\n"; // CC to
$headers .= "bcc: [email protected], [email protected]"; // BCCs to/* and now mail it */
mail($recipient, $subject, $message, $headers);//摘自PHP MANUAL E文班