|
楼主 |
发表于 2014-1-21 23:10:00
|
显示全部楼层
PHP 发送邮件
mail — 发送邮件
说明 ¶bool mail ( string $to , string $subject , string $message [, string $additional_headers [,string $additional_parameters ]] )
发送一封电子邮件。
参数 ¶to
电子邮件收件人,或收件人列表。
本字符串的格式必须符合 » RFC 2822。例如:
user anotheruser <user <user Another User <anotheruser LF(\n)分隔。每行不能超过 70 个字符。
Caution
(Windows 下)当 PHP 直接连接到 SMTP 服务器时,如果在一行开头发现一个句号,则会被删掉。要避免此问题,将单个句号替换成两个句号。
<?php
$text = str_replace("\n.", "\n..", $text);
?>additional_headers(可选项)
例子:
<?php$to = 'somebody = 'the subject';$message = 'hello world!';$headers = 'From: webmaster . "\r\n" . 'Reply-To: webmaster . "\r\n" . 'X-Mailer: PHP/' . phpversion(); $message = wordwrap($message, 70); mail($to, $subject, $message, $headers);?>
关于更多详细发送html 邮件的详细示例 参考 http://www.zhidao91.com/php-mail/ |
|