////////////////////////////////////////////////////////////
// EmailClass 0.5
// class for sending mail
//
// Paul Schreiber
// php@paulschreiber.com
// http://paulschr " /> 天天色天天插,亚洲欧美不卡中文字幕,亚洲日本一区二区三区高清在线

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

給多個(gè)地址發(fā)郵件的類

<?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技術(shù)給多個(gè)地址發(fā)郵件的類,轉(zhuǎn)載需保留來源!

鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請(qǐng)第一時(shí)間聯(lián)系我們修改或刪除,多謝。

主站蜘蛛池模板: 欧美黑人巨大xxxxxxxx | 国产精品久久久99 | 视频三区精品中文字幕 | 在线播放国产精品 | 亚洲一区二区三区精品国产 | 91av国产视频| 色黄网址| 国产一区二区视频免费 | 无码精品一区二区三区免费视频 | 久一在线 | 国产精品美女久久久久网 | 黄网站视频 | 国语自产免费精品视频在 | 欧美综合网站 | 精品国产福利 | 香蕉av影院 | 玖玖精品视频在线 | 免费国产午夜高清在线视频 | 亚洲无限乱码 | 日本精品一区二区三区在线视频| 久久成人影视 | 91精品国产91久久久久久青草 | 另类av| jizz亚洲视频 | 男女免费视频网站 | 91久久精品国产91性色tv | 国产一区国产二区国产三区 | 亚洲香蕉伊在人在线观看9 亚洲香蕉伊综合在人在线 亚洲香蕉影院 | 亚洲天堂99 | 91精品国产91久久久久福利 | 亚洲一区高清 | 看黄网站在线 | 天天狠狠色综合图片区 | 水蜜桃一二二区视在线 | 久久精品视 | 午夜在线视频免费观看 | 中文字幕日韩精品麻豆系列 | 免费成年人在线观看视频 | 91在线欧美 | 麻豆专区| 99pao在线视频精品免费 |