麻豆小视频在线观看_中文黄色一级片_久久久成人精品_成片免费观看视频大全_午夜精品久久久久久久99热浪潮_成人一区二区三区四区

首頁 > 編程 > PHP > 正文

給多個地址發郵件的類

2019-09-08 23:11:51
字體:
來源:轉載
供稿:網友
<?php  

////////////////////////////////////////////////////////////  
//   EmailClass 0.5  
//   class for sending mail  
//  
//   Paul Schreiber  
//   [email protected]  
//   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",/t    // subject  
///t/t    "how are you?",/t   // message body  
///t/t    "paul",/t/t   // sender's name  
///t/t    "[email protected]",/t // sender's email  
///t/t    array("[email protected]", "[email protected]"), // To: recipients  
///t/t    "[email protected]"      // Cc: recipient  
///t/t   );  
//  
//       print "mail sent, result was" . $m->send();  
//  
//  
//  

if ( ! defined( 'MAIL_CLASS_DEFINED' ) ) {  
/tdefine('MAIL_CLASS_DEFINED', 1 );  

class email {  

/t// the constructor!  
/tfunction email ( $subject, $message, $senderName, $senderEmail, $toList, $ccList=0, $bccList=0, $replyTo=0) {  
/t/t$this->sender = $senderName . " <$senderEmail>";  
/t/t$this->replyTo = $replyTo;  
/t/t$this->subject = $subject;  
/t/t$this->message = $message;  

/t/t// set the To: recipient(s)  
/t/tif ( is_array($toList) ) {  
/t/t/t$this->to = join( $toList, "," );  
/t/t} else {  
/t/t/t$this->to = $toList;  
/t/t}  

/t/t// set the Cc: recipient(s)  
/t/tif ( is_array($ccList) && sizeof($ccList) ) {  
/t/t/t$this->cc = join( $ccList, "," );  
/t/t} elseif ( $ccList ) {  
/t/t/t$this->cc = $ccList;  
/t/t}  
/t/t  
/t/t// set the Bcc: recipient(s)  
/t/tif ( is_array($bccList) && sizeof($bccList) ) {  
/t/t/t$this->bcc = join( $bccList, "," );  
/t/t} elseif ( $bccList ) {  
/t/t/t$this->bcc = $bccList;  
/t/t}  

/t}  

/t// send the message; this is actually just a wrapper for  
/t// PHP's mail() function; heck, it's PHP's mail function done right :-)  
/t// you could override this method to:  
/t// (a) use sendmail directly  
/t// (b) do SMTP with sockets  
/tfunction send () {  
/t/t// create the headers needed by PHP's mail() function  

/t/t// sender  
/t/t$this->headers = "From: " . $this->sender . "/n";  

/t/t// reply-to address  
/t/tif ( $this->replyTo ) {  
/t/t/t$this->headers .= "Reply-To: " . $this->replyTo . "/n";  
/t/t}  

/t/t// Cc: recipient(s)  
/t/tif ( $this->cc ) {  
/t/t/t$this->headers .= "Cc: " . $this->cc . "/n";  
/t/t}  

/t/t// Bcc: recipient(s)  
/t/tif ( $this->bcc ) {  
/t/t/t$this->headers .= "Bcc: " . $this->bcc . "/n";  
/t/t}  
/t  
/t/treturn mail ( $this->to, $this->subject, $this->message, $this->headers );  
/t}  
}  


}  
?>  
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 男女无套免费视频 | 久久2019中文字幕 | 黄色av电影在线播放 | 日本在线观看高清完整版 | 最新se94se在线欧美 | 久久精品亚洲一区二区三区观看模式 | 欧美日本日韩 | 国产精品一品二区三区四区18 | 日韩黄色片在线观看 | 国产精品久久久久久久久久 | 天天草天天干天天射 | 久久免费视频8 | 国产精品视频不卡 | 在线播放91 | 欧美视频一区二区三区在线观看 | 久久亚洲春色中文字幕久久 | 欧美三级短视频 | 国产91久久久久久 | 亚洲小视频 | 禁漫天堂久久久久久久久久 | 福利免费观看 | 久草在线综合 | 久久91精品国产91久久yfo | 中文字幕在线视频日本 | 久久国产夫妻视频 | asian附近女人裸体pics | 少妇的肉体2无删减版 | 日韩黄色影视 | 亚洲欧美日韩久久精品第一区 | 黄色免费小视频网站 | 一级毛片播放 | 污版视频在线观看 | 密室逃脱第一季免费观看完整在线 | 久草在线新时代视觉 | 一级免费在线 | 国产一级毛片高清视频完整版 | 最新福利在线 | 久久综合综合久久 | 麻豆视频国产在线观看 | www.guochan | av免费av|