我的一亩三分地 我就喜欢!
13fen  设为主页
 收藏本站
 
当前位置: > 一亩三分地:首页 > 网络学院 > 网络编程 > PHP专区 > php深入/精通 > 网上找到的两个PHP发送邮件的例子,很不错,贴出来给初学者
热门文章排行
热门文章排行 检查email地址格式的代码(01-11)
PHP操作文件问答(01-11)
PHP安装攻略:安装并配置PHP(10-23)
PHP的十个高级技巧 4(10-23)
PHP控制语句(10-12)
精采文章排行
精采文章排行 PHP连接MYSQL的两种方法(11-15)
PHP和MySQL开发的8个技巧(10-23)
PHP安装攻略:安装并配置PHP(10-23)
php+mysql扎实个人基本功(10-23)
PHP编程常用技巧四则(10-23)
技术专题推荐
网管论坛交流
 

网上找到的两个PHP发送邮件的例子,很不错,贴出来给初学者 

作者:佚名   来源:本站教程   点击:   日期:2007-01-11

Advanced Example


Here we will show the full capabilities of the PHP mail function.

PHP Code:
<?php

echo "<html><body>";

$recipient = "Kris Arndt <karn@nucleus.com>,npl@nucleus.com";
$subject = "Testing the mail function";
$message = "Hello!\n\nThis is the body of the message.\n\n";
$extra = "From: kris@phpworld.com\r\nReply-To: karn@nucleus.com\r\n";

mail ($recipient, $subject, $message, $extra);

echo "Sending mail...";
echo "</body></html>";

?>



We send an email to two people this time, by putting two email addresses in the recipient field and separating them with commas.

The fourth parameter holds extra headers for the email.  We specify who the email was from and who the recipient should reply to.  When entering multiple headers, separate them with the line feed and new line combination ('\r\n').



文章评论】 【收藏本文】 【推荐好友】 【打印本文】 【论坛讨论

   相关文章:
·将OICQ数据转成MYSQL数据 ·用PHP实现ODBC数据分页显示一例
·php生成WAP页面 ·PHP与Javascript的两种交互方式
·PHP+Javascript模拟Matrix画面 ·WHOIS类的修改版

   文章评论:(条)
  
 请留名: 匿名评论   点击查看所有评论 网管论坛
 

  责任编辑:一分  声明:刊登此文章是为了传递更多信息,文章内容仅供参考,转载请注明出处。