mail()函数一定要linux下面才能用的,而且要装上email服务器
解决方案 »
- new SimpleXMLElement在服务器上用不了,是什么原因?
- php客户端和c服务器端通信问题
- 获得file的整个路径(针对firefox)
- JAVASCRIPT动态添加表单,多个文件上传问题
- 学习php一个月一般到什么程度?
- array里的删除后和数据库里的不对应了怎么办?
- 正则表达式中对单词的处理问题:如要匹配[中国]?、^[中国],它会匹配成中或国,而不能匹配中国。有处理的办法吗?谢谢!
- 如何读取带颜色,链接,文字大小的数据库
- 关于连接 MS SQL Server 的权限的问题。
- 在客服端抓取服务器本地的url怎么提高速度??
- 如何配置apache2.036+php4.21的模块方式?
- 小妹想做一个论坛,希望大虾们能指教一下小妹!谢谢了!
Example 2. Sending mail with extra headers.mail("[email protected]", "the subject", $message,
"From: webmaster@$SERVER_NAME\r\n"
."Reply-To: webmaster@$SERVER_NAME\r\n"
."X-Mailer: PHP/" . phpversion());
Example 3. Sending mail with extra headers and setting an additional command line parameter.mail("[email protected]", "the subject", $message,
"From: webmaster@$SERVER_NAME", "-fwebmaster@$SERVER_NAME");
Example 4. Sending complex email./* recipients */
$to = "Mary <[email protected]>" . ", " ; //note the comma
$to .= "Kelly <[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 .= "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);
Example5:
<?
$message="abcdefghijklmnopqrstuvwxyz";
mail("[email protected]", "没有主题", $message, "From: [email protected]\nReply-To: [email protected]\nX-Mailer: PHP/" . phpversion());
?>
不過一定要在linux下才能用。win2k是不能用的。
smtp服务器的的话,比较多,我用的 imail,可以去网上下载的,它的功能比较多的,注意的是要在 php.ini中的mail function中设置
SMTP =localhost
sendmail_from=你自己的信箱。
还有mail()函数的参数不是很多吗?
格式 boolean mail(string to, string subject, string message, string [additional_headers]);
分别指 目标地址,主题,内容,以及 headers。
列子就不举,如果还有什么问题,欢迎来信。
我的计算机里没有smtp应该到哪去找呀!请您再说得详细点可以吗?
我将非常感谢。请您帮帮忙,我的确很着急!
请各位多帮帮忙。我一定高分回报!