动网论坛,站长建站首选,国内使用量最多的论坛软件 动网论坛官方技术讨论区 站长工具 申请属于您自己的免费论坛
首页 | 新闻资讯 | 网站运营 | 网络编程 | 数据库 | 服务器 | 网页设计 | 图像媒体 | 网络应用 | 搜索优化 | 资源下载 | 动网主机 | DVBOX
    本站内  互联网 ASP论坛  ASP.Net论坛  PHP论坛
   PHP → 阅读文章

 网上找到的两个PHP发送邮件的例子,很不错,贴出来给初学者参考吧(不知道是否有兄弟曾贴过),呵呵(1)

作者来源: 
阅读 数 575 人次 , 2006-4-18 16:45:00 


   Send Mail in PHP

In this example, we will show how to send an email message to someone in PHP.


PHP Code:
<?php

echo "<html><body>";

mail ("karn@nucleus.com", "Subject", "Hello!");

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

?>



It is that simple!

The PHP mail function has up to four parameters.  The first parameter is the recipient of the message.  The second parameter is the subject of the email message.  The third parameter is the body of the message.  And the fourth parameter is optional, which will be covered on the next page.

If the above example does not work when you view it in your browser then the Sendmail variable in your PHP setup file is probably not set correctly.  In UNIX, it should be set to something like '/usr/sbin/sendmail -t'.  Consult your PHP documentation for more in depth instructions.   
 本文Tags邮件  
 收藏本文  打印本文  论坛讨论  关闭窗口
· 上一篇:用PHP实现POP3邮件的解码(一)
· 下一篇:网上找到的两个PHP发送邮件的例子,很不错,贴出来给初学者参考吧(不知道是否有兄弟曾贴过),呵呵(2)
· 关于下载doc,xls文件的办法(java source)
· 一个用PHP写的中文分词函数
· PHP 和 MySQL 开发的 8 个技巧
· 我的论坛源代码(十)
· PHP个人网站架设连环讲(四)


关于本站 | 联系我们 | 业务合作 | 客户案例 | 诚聘英才 | 广告合作 | 收藏本站
海口动网先锋网络科技有限公司版权所有
Copyright © 2000 - 2006 Cndw.Com
中华人民共和国电信与信息服务业务经营许可证编号 琼 ICP 020077