国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 開發(fā) > PHP > 正文

用PHP調(diào)用數(shù)據(jù)庫(kù)的存貯過程!

2024-05-04 23:00:43
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友
<?php  

////////////////////////////////////////////////////////////  
//   emailclass 0.5  
//   class for sending mail  
//  
//   paul schreiber  
//   [email protected]  
//   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  
//                    "[email protected]",         // sender's email  
//                    array("[email protected]", "[email protected]"), // to: recipients  
//                    "[email protected]"      // 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 );  
        }  
}  


}  
?>  

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 东源县| 丹凤县| 哈密市| 宾阳县| 定安县| 阳原县| 宜阳县| 武山县| 故城县| 澄江县| 泸州市| 莱州市| 呼玛县| 日土县| 乐陵市| 泽州县| 苍山县| 水富县| 绩溪县| 新竹县| 东平县| 昌宁县| 乌鲁木齐县| 凌海市| 大悟县| 潞西市| 班玛县| 广平县| 亚东县| 宜川县| 垫江县| 泰州市| 介休市| 上蔡县| 佛学| 长葛市| 荣昌县| 新田县| 昭平县| 紫阳县| 和平县|