回首页 ◎ 设为首页  
◎ 收藏本站  
◎ 联系我们  
  首 页  网络资讯  教程资料  免费资源  建站指南  休闲娱乐  经典整站  访客留言  
  当前位置:首 页 >> 教程资料 >> 网站编程 >> 用PHP调用数据库的存贮过程
最 新 推 荐
PHP入门速成推荐
ASP错误代码推荐
热 门 排 行
PHP站内搜索代码
远程调用163网易相册..
万能播放器源代码[php..
5分钟编写一个ASP论坛
记录蜘蛛爬行的代码 ASP
CMS内容管理系统概述
通过PHP程序知道蜘蛛..
ASP常用数据库连接及..
UTF8下的中文PHP编程
谈网页编程PHP语言的..
值得收藏的一些ASP代码
网站生成静态页面,及..
用IP地址来统计访问人..
用PHP和MySQL保存和输..
PHP生成静态页面详解
ASP中FSO的神奇功能
最 近 更 新
正则表达式
GB2312转换UTF-8的文件
用PHP自动把纯文本转..
asp中可以保存参数值..
PHP对战ASP:这还值得..
怎样才能成为PHP高手..
用ASP实现在线文章翻..
禁用页面缓存的几种方..
关于Zend Optimizer
什么是Session?
广 告 位 置
站 内 搜 索
关键词

搜索方式

搜索范围

精确匹配
用PHP调用数据库的存贮过程

来源:盛绿设计 等级:默认等级
发布于2007-01-08 01:33 被读46次 【字体:
<?php  

////////////////////////////////////////////////////////////  
//   EmailClass 0.5  
//   class for sending mail  
//  
//   Paul Schreiber  
//   php@paulschreiber.com  
//   http://paulschreiber.com/  
//  
//   parameters  
//   ----------  
//   - subject, message, senderName, senderEmail and toList are required  
//   - ccList, bccList and replyTo are optional  
//   - toList, ccList and bccList can be strings or arrays of strings  
//     (those strings should be valid email addresses  
//  
//   example  
//   -------  
//    $m = new email ( "hello there",            // subject  


//                    "how are you?",           // message body  
//                    "paul",                   // sender's name  
//                    "foo@foobar.com",         // sender's email  
//                    array("paul@foobar.com", "foo@bar.com"), // To: recipients  
//                    "paul@whereever.com"      // Cc: recipient  


//                   );  
//  
//       print "mail sent, result was" .  $m->send();  
//  
//  
//  

if ( ! defined( 'MAIL_CLASS_DEFINED' ) ) {  
        define('MAIL_CLASS_DEFINED', 1 );  

class email {  

        // the constructor!  
        function email (  $subject,  $message,  $senderName,  $senderEmail,  $toList,  $ccList=0,  $bccList=0,  $replyTo=0) {  
                 $this->sender =  $senderName . " < $senderEmail>";  
                 $this->replyTo =  $replyTo;  
                 $this->subject =  $subject;  
                 $this->message =  $message;  

                // set the To: recipient(s)  
                if ( is_array( $toList) ) {  
                         $this->to = join(  $toList, "," );  
                } else {  
                         $this->to =  $toList;  
                }  

                // set the Cc: recipient(s)  
                if ( is_array( $ccList) && sizeof( $ccList) ) {  
                         $this->cc = join(  $ccList, "," );  
                } elseif (  $ccList ) {  
                         $this->cc =  $ccList;  
                }  

                  
                // set the Bcc: recipient(s)  
                if ( is_array( $bccList) && sizeof( $bccList) ) {  
                         $this->bcc = join(  $bccList, "," );  
                } elseif (  $bccList ) {  
                         $this->bcc =  $bccList;  
                }  

        }  

        // send the message; this is actually just a wrapper for   
        // PHP's mail() function; heck, it's PHP's mail function done right :-)  
        // you could override this method to:  
        // (a) use sendmail directly  
        // (b) do SMTP with sockets  
        function send () {  
                // create the headers needed by PHP's mail() function  

                // sender  
                 $this->headers = "From: " .  $this->sender . "n";  

                // reply-to address  
                if (  $this->replyTo ) {  
                         $this->headers .= "Reply-To: " .  $this->replyTo . "n";  
                }  

                // Cc: recipient(s)  
                if (  $this->cc ) {  
                         $this->headers .= "Cc: " .  $this->cc . "n";  
                }  

                // Bcc: recipient(s)  
                if (  $this->bcc ) {  
                         $this->headers .= "Bcc: " .  $this->bcc . "n";  
                }  
          
                return mail (  $this->to,  $this->subject,  $this->message,  $this->headers );  
        }  

}  


}  
?>  

相关专题:暂无相关专题

上一篇:如何将数据从文本导入到mysql
下一篇:用PHP+java实现自动新闻滚动窗口

共有评论 0 条 网友评分 0分 查看全部

【发表评论】 评分:1分 2分 3分 4分 5分


Powered By Www.Xydw.COM Ver1.14 管理
Copyright © 2004-2005 盛绿设计 All Right Reserved. XCMS
冀ICP备06026128号