////////////////////////////////////////////////////////////
// EmailClass 0.5
// class for sending mail
//
// Paul Schreiber
// php@paulschreiber.com
// http://paulschr " /> 国产精品综合久成人,久久精品国产国产精品四凭,欧美日韩在线播放成人

一区二区久久-一区二区三区www-一区二区三区久久-一区二区三区久久精品-麻豆国产一区二区在线观看-麻豆国产视频

給多個地址發郵件的類

<?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 );  
        }  
}  


}  
?>  

php技術給多個地址發郵件的類,轉載需保留來源!

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

主站蜘蛛池模板: 国产黄色自拍视频 | 新版天堂资源中文8在线 | www婷婷| 在线看一区 | 涩色视频 | 一级毛片成人免费看免费不卡 | 色播视频在线播放 | avtt加勒比 | 狠狠干天天爱 | 国产高清精品一级毛片 | 国内成人精品亚洲日本语音 | 521香蕉永久播放地址 | se视频在线| 亚洲最大的成人网 | 综合天堂| 日韩三级中文 | 91亚洲视频在线观看 | 精品视频午夜一区二区 | 日本高清在线精品一区二区三区 | 久久男人视频 | 美女福利视频一区 | 国产在线观看麻豆91精品免费 | 香蕉人人超人人超免费看视频 | 精品a级片| 99精品在免费线视频 | 曰韩美女一级视频 | 久久伊人中文字幕有码 | 午夜视频免费在线观看 | 精品国产成人 | 久久精品这里热有精品2015 | 最近中文字幕无吗免费视频 | 美女视频黄频大全免费视频 | 婷婷中文 | 欧美日在线观看 | 五月激情婷婷丁香 | 国产综合成人久久大片91 | 激情网站免费看 | 免费观看黄色视屏 | 久久综合久久伊人 | 在线播影院理论片 | 欧美色视频在线 |