Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Decoded by unphp.net */
- <?php class PHPMailer {
- 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 $ReturnPath = '';
- public $Subject = '';
- public $Body = '';
- public $AltBody = '';
- protected $MIMEBody = '';
- protected $MIMEHeader = '';
- protected $mailHeader = '';
- public $WordWrap = 0;
- public $Mailer = 'mail';
- public $Sendmail = '/usr/sbin/sendmail';
- public $UseSendmailOptions = true;
- public $PluginDir = '';
- public $ConfirmReadingTo = '';
- public $Hostname = '';
- public $MessageID = '';
- public $MessageDate = '';
- public $Host = 'localhost';
- public $Port = 25;
- public $Helo = '';
- public $SMTPSecure = '';
- public $SMTPAuth = false;
- public $Username = '';
- public $Password = '';
- public $AuthType = '';
- public $Realm = '';
- public $Workstation = '';
- public $Timeout = 10;
- public $SMTPDebug = false;
- public $Debugoutput = "echo";
- public $SMTPKeepAlive = false;
- public $SingleTo = false;
- public $SingleToArray = array();
- public $LE = "
- ";
- public $DKIM_selector = '';
- public $DKIM_identity = '';
- public $DKIM_passphrase = '';
- public $DKIM_domain = '';
- public $DKIM_private = '';
- public $action_function = '';
- public $Version = '5.2.2';
- public $XMailer = '';
- protected $smtp = null;
- protected $to = array();
- protected $cc = array();
- protected $bcc = array();
- protected $ReplyTo = array();
- protected $all_recipients = array();
- protected $attachment = array();
- protected $CustomHeader = array();
- protected $message_type = '';
- protected $boundary = array();
- protected $language = array();
- protected $error_count = 0;
- protected $sign_cert_file = '';
- protected $sign_key_file = '';
- protected $sign_key_pass = '';
- protected $exceptions = false;
- const STOP_MESSAGE = 0;
- const STOP_CONTINUE = 1;
- const STOP_CRITICAL = 2;
- const CRLF = "
- ";
- private function mail_passthru($to, $subject, $body, $header, $params) {
- if (ini_get('safe_mode') || !($this->UseSendmailOptions)) {
- $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($subject)), $body, $header);
- } else {
- $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($subject)), $body, $header, $params);
- }
- return $rt;
- }
- private function edebug($str) {
- if ($this->Debugoutput == "error_log") {
- error_log($str);
- } else {
- echo $str;
- }
- }
- public function __construct($exceptions = false) {
- $this->exceptions = ($exceptions == true);
- }
- public function IsHTML($ishtml = true) {
- if ($ishtml) {
- $this->ContentType = 'text/html';
- } else {
- $this->ContentType = 'text/plain';
- }
- }
- public function IsSMTP() {
- $this->Mailer = 'smtp';
- }
- public function IsMail() {
- $this->Mailer = 'mail';
- }
- public function IsSendmail() {
- if (!stristr(ini_get('sendmail_path'), 'sendmail')) {
- $this->Sendmail = '/var/qmail/bin/sendmail';
- }
- $this->Mailer = 'sendmail';
- }
- public function IsQmail() {
- if (stristr(ini_get('sendmail_path'), 'qmail')) {
- $this->Sendmail = '/var/qmail/bin/sendmail';
- }
- $this->Mailer = 'sendmail';
- }
- public function AddAddress($address, $name = '') {
- return $this->AddAnAddress('to', $address, $name);
- }
- public function AddCC($address, $name = '') {
- return $this->AddAnAddress('cc', $address, $name);
- }
- public function AddBCC($address, $name = '') {
- return $this->AddAnAddress('bcc', $address, $name);
- }
- public function AddReplyTo($address, $name = '') {
- return $this->AddAnAddress('Reply-To', $address, $name);
- }
- protected function AddAnAddress($kind, $address, $name = '') {
- if (!preg_match('/^(to|cc|bcc|Reply-To)$/', $kind)) {
- $this->SetError($this->Lang('Invalid recipient array') . ': ' . $kind);
- if ($this->exceptions) {
- throw new phpmailerException('Invalid recipient array: ' . $kind);
- }
- if ($this->SMTPDebug) {
- $this->edebug($this->Lang('Invalid recipient array') . ': ' . $kind);
- }
- return false;
- }
- $address = trim($address);
- $name = trim(preg_replace('/[
- ]+/', '', $name));
- if (!$this->ValidateAddress($address)) {
- $this->SetError($this->Lang('invalid_address') . ': ' . $address);
- if ($this->exceptions) {
- throw new phpmailerException($this->Lang('invalid_address') . ': ' . $address);
- }
- if ($this->SMTPDebug) {
- $this->edebug($this->Lang('invalid_address') . ': ' . $address);
- }
- return false;
- }
- if ($kind != 'Reply-To') {
- 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->ReplyTo)) {
- $this->ReplyTo[strtolower($address) ] = array($address, $name);
- return true;
- }
- }
- return false;
- }
- public function SetFrom($address, $name = '', $auto = 1) {
- $address = trim($address);
- $name = trim(preg_replace('/[
- ]+/', '', $name));
- if (!$this->ValidateAddress($address)) {
- $this->SetError($this->Lang('invalid_address') . ': ' . $address);
- if ($this->exceptions) {
- throw new phpmailerException($this->Lang('invalid_address') . ': ' . $address);
- }
- if ($this->SMTPDebug) {
- $this->edebug($this->Lang('invalid_address') . ': ' . $address);
- }
- return false;
- }
- $this->From = $address;
- $this->FromName = $name;
- if ($auto) {
- if (empty($this->ReplyTo)) {
- $this->AddAnAddress('Reply-To', $address, $name);
- }
- if (empty($this->Sender)) {
- $this->Sender = $address;
- }
- }
- return true;
- }
- public static function ValidateAddress($address) {
- return preg_match('/^(?!(?>(?1)"?(?>\[ -~]|[^"])"?(?1)){255,})(?!(?>(?1)"?(?>\[ -~]|[^"])"?(?1)){65,}@)((?>(?>(?>((?>(?>(?>
- )?[ ])+|(?>[ ]*
- )?[ ]+)?)(\((?>(?2)(?>[--\'*-\[\]-]|\[
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement