////////////////////////////////////////////////////////////
// EmailClass 0.5
// class for sending mail
//
// Paul Schreiber
// php@paulschreiber.com
// http://paulschr " /> 亚洲第一色网,日日操夜夜操狠狠操,欧美亚洲另类热图

天天躁日日躁狠狠躁AV麻豆-天天躁人人躁人人躁狂躁-天天澡夜夜澡人人澡-天天影视香色欲综合网-国产成人女人在线视频观看-国产成人女人视频在线观看

給多個地址發郵件的類

<?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技術給多個地址發郵件的類,轉載需保留來源!

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

主站蜘蛛池模板: 2020年国产精品午夜福利在线观看 | 伊人热 | 老奶奶50p | 久久综合中文字幕佐佐木希 | 性色AV一区二区三区V视界影院 | 亚洲人成网站7777视频 | 国产毛片AV久久久久精品 | 国产盗摄一区二区三区 | np高h肉文 | 奇米色偷偷 | 色悠久久久久综合网小说 | 一本色道久久综合亚洲精品加 | 99久久亚洲精品影院 | 天堂草原天黑黑 | 日本无码人妻丰满熟妇5G影院 | 花蝴蝶在线观看中字 | 一天不停的插BB十几次 | 国产成人精品区在线观看 | 亚洲精品第一综合99久久 | 無码一区中文字幕少妇熟女网站 | 老熟女重囗味HDXX | 午夜福利影院私人爽爽 | 亚洲成片在线看 | FREESEXVIDEO 性老少配 | 亚洲精品中文字幕一二三四区 | 野花韩国高清完整版在线 | 中文人妻熟妇精品乱又伦 | 亚洲无线码一区在线观看 | 第一福利在线永久视频 | 第一次玩老妇真实经历 | 美女隐私黄www视频 美女议员被泄裸照 | 最新日本免费一区 | 欧美日韩精品不卡在线观看 | 跪趴式啪啪GIF动态图27报 | 野草在线视频完整视频 | 蜜柚影院在线观看免费高清中文 | 亚洲一区精品伊人久久伊人 | 久久精品国产亚洲AV未满十八 | 免费人成网站在线观看10分钟 | 起碰免费公开97在线视频 | 亚洲VA欧美VA天堂V国产综合 |