国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

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

php中文網(wǎng)
發(fā)布: 2016-06-01 12:27:05
原創(chuàng)
1362人瀏覽過

////////////////////////////////////////////////////////////??
//???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 . " ";??
????????????????$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速學(xué)教程(入門到精通)
PHP速學(xué)教程(入門到精通)

PHP怎么學(xué)習(xí)?PHP怎么入門?PHP在哪學(xué)?PHP怎么學(xué)才快?不用擔(dān)心,這里為大家提供了PHP速學(xué)教程(入門到精通),有需要的小伙伴保存下載就能學(xué)習(xí)啦!

下載
來源:php中文網(wǎng)
本文內(nèi)容由網(wǎng)友自發(fā)貢獻(xiàn),版權(quán)歸原作者所有,本站不承擔(dān)相應(yīng)法律責(zé)任。如您發(fā)現(xiàn)有涉嫌抄襲侵權(quán)的內(nèi)容,請(qǐng)聯(lián)系admin@php.cn
最新問題
開源免費(fèi)商場系統(tǒng)廣告
最新下載
更多>
網(wǎng)站特效
網(wǎng)站源碼
網(wǎng)站素材
前端模板
關(guān)于我們 免責(zé)申明 意見反饋 講師合作 廣告合作 最新更新
php中文網(wǎng):公益在線php培訓(xùn),幫助PHP學(xué)習(xí)者快速成長!
關(guān)注服務(wù)號(hào) 技術(shù)交流群
PHP中文網(wǎng)訂閱號(hào)
每天精選資源文章推送
PHP中文網(wǎng)APP
隨時(shí)隨地碎片化學(xué)習(xí)
PHP中文網(wǎng)抖音號(hào)
發(fā)現(xiàn)有趣的

Copyright 2014-2025 http://m.miracleart.cn/ All Rights Reserved | php.cn | 湘ICP備2023035733號(hào)