无为清净楼资源网 Design By www.qnjia.com
<?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 );
}
}
}
?>
////////////////////////////////////////////////////////////
// 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 );
}
}
}
?>
无为清净楼资源网 Design By www.qnjia.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
无为清净楼资源网 Design By www.qnjia.com
暂无评论...
更新日志
2024年11月15日
2024年11月15日
- faker大魔王称号怎么来的 faker大魔王称号来源介绍
- PS5 Pro上的蒂法更美了!博主盛赞新机1000%值得购买
- 腾讯互娱再离职一员大将!或因供应商贪腐
- Ayaneo3游戏掌机预热:旗舰定位、造型圆润自带底键
- 动力火车.1999-背叛情歌【上华】【WAV+CUE】
- 刘力扬.2019-Neon.Lit虹【摩登天空】【FLAC分轨】
- 群星.2002-恋爱物语情歌对唱精选2CD(引进版)【滚石】【WAV+CUE】
- 群星《闽南情24K德国HD金碟》2CD[WAV+CUE]
- 周传雄《恋人创世纪》环球唱片[WAV+CUE]
- 关淑怡-《真假情话K2HD》(日本压制)【WAV+CUE】
- 王菲 -《Faye Wong》雨果LPCD45 [WAV+分轨][1G]
- 陈百强《世纪10星·永恒篇》环球[WAV+CUE][1G]
- 陈奕迅《黑·白·灰》台湾版[WAV+CUE][400M]
- 张尕怂.2024-甘肃娃娃【FLAC分轨】
- 张惠妹.2011-A.MEI.ACOUSTIC.BEST.2CD【丰华】【WAV+CUE】