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

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

主站蜘蛛池模板: 久久精品中文字幕极品 | 亚洲播播播 | 国产成人aa视频在线观看 | 久久综合网久久综合 | 日日碰碰 | 日本高清色视频在线观看免费 | 日韩视频91 | 玖玖色在线| 国产久热香蕉在线观看 | 色图影院 | 69视频免费观看l | 国产在视频 | 久久93精品国产91久久综合 | 97菊爱网| 亚洲欧美一区二区久久 | 成人国产在线24小时播放视频 | 中文字幕一区二区三区5566 | 国产精品一区二区在线观看 | 激情小视频在线 | 免费小视频在线观看 | 日本www色视频 | 一区二区三区网站在线免费线观看 | 欧美一a一片一级一片 | 午夜久久网 | 国产三区视频 | 美女三级毛片 | 日韩一区精品 | 91在线视频国产 | 欧美另类videosbestsex高清 | 午夜精品在线免费观看 | 国产亚洲精品福利片 | 日韩三级一区二区三区 | 91小视频在线观看 | 四房婷婷 | 三区在线观看 | 东京加勒比2021一区 | 真实国产乱子伦视频 | 狠狠色噜噜狠狠狠狠米奇7777 | 青草资源站 | 中文字幕久久久久久精 | 成人综合在线视频 |