<?php
if (version_compare(PHP_VERSION, '5.0.0', '<') ) exit("Sorry, this version of PHPMailer will only run on PHP version 5 or greater!\n");
class Phpmailer_class {
public $Priority = 3;
public $CharSet = 'iso-8859-1';
public $ContentType = 'text/plain';
public $Encoding = '8bit';
public $ErrorInfo = '';
public $From = 'root@localhost';
public $FromName = 'Root User';
public $Sender = '';
public $Subject = '';
public $Body = '';
public $AltBody = '';
public $WordWrap = 0;
public $Mailer = 'mail';
public $Sendmail = '/usr/sbin/sendmail';
public $PluginDir = '';
public $ConfirmReadingTo = '';
public $Hostname = '';
public $MessageID = '';
public $Host = 'localhost';
public $Port = 25;
public $Helo = '';
public $SMTPSecure = '';
public $SMTPAuth = false;
public $Username = '';
public $Password = '';
public $Timeout = 10;
public $SMTPDebug = false;
public $SMTPKeepAlive = false;
public $SingleTo = false;
/**
* If SingleTo is true, this provides the array to hold the email addresses
* @var bool
*/
public $SingleToArray = array();
/**
* Provides the ability to change the line ending
* @var string
*/
public $LE = "\n";
/**
* Used with DKIM DNS Resource Record
* @var string
*/
public $DKIM_selector = 'phpmailer';
/**
* Used with DKIM DNS Resource Record
* optional, in format of email address 'you@yourdomain.com'
* @var string
*/
public $DKIM_identity = '';
/**
* Used with DKIM DNS Resource Record
* optional, in format of email address 'you@yourdomain.com'
* @var string
*/
public $DKIM_domain = '';
/**
* Used with DKIM DNS Resource Record
* optional, in format of email address 'you@yourdomain.com'
* @var string
*/
public $DKIM_private = '';
/**
* Callback Action function name
* the function that handles the result of the send email action. Parameters:
* bool $result result of the send action
* string $to email address of the recipient
* string $cc cc email addresses
* string $bcc bcc email addresses
* string $subject the subject
* string $body the email body
* @var string
*/
public $action_function = ''; //'callbackAction';
/**
* Sets the PHPMailer Version number
* @var string
*/
public $Version = '5.1';
/////////////////////////////////////////////////
// PROPERTIES, PRIVATE AND PROTECTED
/////////////////////////////////////////////////
private $smtp = NULL;
private $to = array();
private $cc = array();
private $bcc = array();
private $ReplyTo = array();
private $all_recipients = array();
private $attachment = array();
private $CustomHeader = array();
private $message_type = '';
private $boundary = array();
protected $language = array();
private $error_count = 0;
private $sign_cert_file = "";
private $sign_key_file = "";
private $sign_key_pass = "";
private $exceptions = false;
/////////////////////////////////////////////////
// CONSTANTS
/////////////////////////////////////////////////
const STOP_MESSAGE = 0; // message only, continue processing
const STOP_CONTINUE = 1; // message?, likely ok to continue processing
const STOP_CRITICAL = 2; // message, plus full stop, critical error reached
/////////////////////////////////////////////////
// METHODS, VARIABLES
/////////////////////////////////////////////////
/**
* Constructor
* @param boolean $exceptions Should we throw external exceptions?
*/
public function __construct($exceptions = false) {
$this->exceptions = ($exceptions == true);
}
/**
* Sets message type to HTML.
* @param bool $ishtml
* @return void
*/
public function IsHTML($ishtml = true) {
if ($ishtml) {
$this->ContentType = 'text/html';
} else {
$this->ContentType = 'text/plain';
}
}
/**
* Sets Mailer to send message using SMTP.
* @return void
*/
public function IsSMTP() {
$this->Mailer = 'smtp';
}
/**
* Sets Mailer to send message using PHP mail() function.
* @return void
*/
public function IsMail() {
$this->Mailer = 'mail';
}
/**
* Sets Mailer to send message using the $Sendmail program.
* @return void
*/
public function IsSendmail() {
if (!stristr(ini_get('sendmail_path'), 'sendmail')) {
$this->Sendmail = '/var/qmail/bin/sendmail';
}
$this->Mailer = 'sendmail';
}
/**
* Sets Mailer to send message using the qmail MTA.
* @return void
*/
public function IsQmail() {
if (stristr(ini_get('sendmail_path'), 'qmail')) {
$this->Sendmail = '/var/qmail/bin/sendmail';
}
$this->Mailer = 'sendmail';
}
/////////////////////////////////////////////////
// METHODS, RECIPIENTS
/////////////////////////////////////////////////
/**
* Adds a "To" address.
* @param string $address
* @param string $name
* @return boolean true on success, false if address already used
*/
public function AddAddress($address, $name = '') {
return $this->AddAnAddress('to', $address, $name);
}
/**
* Adds a "Cc" address.
* Note: this function works with the SMTP mailer on win32, not with the "mail" mailer.
* @param string $address
* @param string $name
* @return boolean true on success, false if address already used
*/
public function AddCC($address, $name = '') {
return $this->AddAnAddress('cc', $address, $name);
}
/**
* Adds a "Bcc" address.
* Note: this function works with the SMTP mailer on win32, not with the "mail" mailer.
* @param string $address
* @param string $name
* @return boolean true on success, false if address already used
*/
public function AddBCC($address, $name = '') {
return $this->AddAnAddress('bcc', $address, $name);
}
/**
* Adds a "Reply-to" address.
* @param string $address
* @param string $name
* @return boolean
*/
public function AddReplyTo($address, $name = '') {
return $this->AddAnAddress('ReplyTo', $address, $name);
}
/**
* Adds an address to one of the recipient arrays
* Addresses that have been added already return false, but do not throw exceptions
* @param string $kind One of 'to', 'cc', 'bcc', 'ReplyTo'
* @param string $address The email address to send to
* @param string $name
* @return boolean true on success, false if address already used or invalid in some way
* @access private
*/
private function AddAnAddress($kind, $address, $name = '') {
if (!preg_match('/^(to|cc|bcc|ReplyTo)$/', $kind)) {
if ($this->SMTPDebug)echo 'Invalid recipient array: ' . kind;
return false;
}
$address = trim($address);
$name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim
if (!self::ValidateAddress($address)) {
$this->SetError($this->Lang('invalid_address').': '. $address);
if ($this->exceptions) {
throw new phpmailerException($this->Lang('invalid_address').': '.$address);
}
if ($this->SMTPDebug)echo $this->Lang('invalid_address').': '.$address;
return false;
}
if ($kind != 'ReplyTo') {
if (!isset($this->all_recipients[strtolower($address)])) {
array_push($this->$kind, array($address, $name));
$this->all_recipients[strtolower($address)] = true;
return true;
}
} else {
if (!array_key_exists(strtolower($address), $this->Rep
没有合适的资源?快使用搜索试试~ 我知道了~
完整实用的威客源码采用PHP编写
共1639个文件
gif:753个
php:339个
png:218个
需积分: 10 38 下载量 103 浏览量
2011-05-19
09:43:04
上传
评论
收藏 4.57MB RAR 举报
温馨提示
完整的威客程序,采用PHP编写,下载立即可以使用!
资源详情
资源评论
资源推荐
收起资源包目录
完整实用的威客源码采用PHP编写 (1639个子文件)
httpd.conf 3KB
main.css 15KB
base.css 13KB
manage.css 9KB
ui.css 9KB
ui.css 9KB
ui.css 9KB
ui.css 8KB
style.css 6KB
index.css 5KB
login.css 3KB
style.css 2KB
dangdang.css 2KB
tab.css 2KB
iframe.css 2KB
iframe.css 2KB
iframe.css 2KB
iframe.css 2KB
space2.css 2KB
space1.css 1KB
base.css 794B
Thumbs.db 279KB
Thumbs.db 156KB
Thumbs.db 81KB
Thumbs.db 70KB
Thumbs.db 60KB
Thumbs.db 60KB
Thumbs.db 39KB
Thumbs.db 32KB
Thumbs.db 26KB
Thumbs.db 18KB
Thumbs.db 11KB
Thumbs.db 11KB
Thumbs.db 8KB
Thumbs.db 7KB
Thumbs.db 6KB
Thumbs.db 6KB
Thumbs.db 6KB
Thumbs.db 4KB
Thumbs.db 4KB
caveman.gdf 157KB
bubblebath.gdf 66KB
automatic.gdf 60KB
crass.gdf 39KB
1.gif 54KB
01.gif 53KB
05.gif 51KB
2.gif 51KB
04.gif 49KB
03.gif 36KB
02.gif 34KB
02.gif 34KB
medal1.gif 33KB
medal9.gif 31KB
medal6.gif 31KB
medal10.gif 31KB
medal8.gif 30KB
medal4.gif 29KB
adv.gif 28KB
sql5bg.gif 28KB
medal3.gif 26KB
medal2.gif 26KB
medal5.gif 24KB
medal7.gif 22KB
space_img1.gif 21KB
adv_2.gif 20KB
adv_2.gif 20KB
adv_3.gif 14KB
adv_3.gif 14KB
hot_3.gif 14KB
hot_2.gif 13KB
hot_1.gif 13KB
36.gif 13KB
43.gif 13KB
folder_new.gif 13KB
folder_common.gif 13KB
newarow.gif 13KB
newarow.gif 13KB
big_5.gif 12KB
process_img1.gif 11KB
ajax_loader.gif 11KB
41.gif 10KB
process_img2.gif 9KB
task_process.gif 9KB
toux.gif 8KB
19.gif 8KB
20.gif 8KB
12.gif 8KB
main_bot_bg3.gif 8KB
titter.gif 7KB
rwd.gif 7KB
33.gif 7KB
01.gif 7KB
main_bot_bg2.gif 7KB
50.gif 6KB
main_bot_bg1.gif 6KB
zhongbiao.gif 6KB
editor.gif 6KB
04.gif 6KB
03.gif 6KB
共 1639 条
- 1
- 2
- 3
- 4
- 5
- 6
- 17
Ancle2008
- 粉丝: 0
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0