////////////////////////////////////////////////////////////
// EmailClass 0.5
// class for sending mail
//
// Paul Schreiber
// php@paulschreiber.com
// http://paulschr " /> 激情亚洲视频,深夜福利91,亚洲精品高清久久

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

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

主站蜘蛛池模板: 久久久久久夜精品精品免费啦 | 97精品国产91久久久久久 | 亚洲第一区香蕉_国产a | 国产狂喷冒白浆免费视频 | 亚洲狠狠婷婷综合久久久久图片 | 黄色小视频在线看 | 精品一区二区三区在线视频 | 国产精品短篇二区 | 最新97超级碰碰碰碰久久久久 | 美女被男人扒开下面无遮无挡 | 五月激情婷婷网 | 午夜爽视频 | 色综合久久综合 | 狠狠色噜噜狠狠狠狠奇米777 | 亚洲色吧 | 中文字幕日韩精品中文区 | 亚洲图区综合网 | 婷婷涩五月 | 在线激情视频 | 国产日韩一区二区 | 一区二区三区国产美女在线播放 | 国产精品一区二区三区四区五区 | 丁香婷婷在线视频 | 欧美日韩一区妖精视频yjsp | 国产精品视频公开费视频 | 欧美人与禽 | 热99re久久精品香蕉 | 狠狠久久久久综合网 | 一级做a爰片性色毛片思念网 | 久久成人免费观看全部免费 | 玖玖操| 99视频精品在线 | 国产在线观看色 | 欧美日韩亚洲成人 | 国色天香网在线 | 久久精品视频91 | 伊人色播| 久久久这里有精品 | 国产精品自在线观看剧情 | 黄大色黄美女精品大毛片 | 欧美一级一一特黄 |