Advertisement
Guest User

Nata2

a guest
Mar 31st, 2015
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 6.89 KB | None | 0 0
  1. /* Decoded by unphp.net */
  2.  
  3. <?php class PHPMailer {
  4.     public $Priority = 3;
  5.     public $CharSet = 'iso-8859-1';
  6.     public $ContentType = 'text/plain';
  7.     public $Encoding = '8bit';
  8.     public $ErrorInfo = '';
  9.     public $From = 'root@localhost';
  10.     public $FromName = 'Root User';
  11.     public $Sender = '';
  12.     public $ReturnPath = '';
  13.     public $Subject = '';
  14.     public $Body = '';
  15.     public $AltBody = '';
  16.     protected $MIMEBody = '';
  17.     protected $MIMEHeader = '';
  18.     protected $mailHeader = '';
  19.     public $WordWrap = 0;
  20.     public $Mailer = 'mail';
  21.     public $Sendmail = '/usr/sbin/sendmail';
  22.     public $UseSendmailOptions = true;
  23.     public $PluginDir = '';
  24.     public $ConfirmReadingTo = '';
  25.     public $Hostname = '';
  26.     public $MessageID = '';
  27.     public $MessageDate = '';
  28.     public $Host = 'localhost';
  29.     public $Port = 25;
  30.     public $Helo = '';
  31.     public $SMTPSecure = '';
  32.     public $SMTPAuth = false;
  33.     public $Username = '';
  34.     public $Password = '';
  35.     public $AuthType = '';
  36.     public $Realm = '';
  37.     public $Workstation = '';
  38.     public $Timeout = 10;
  39.     public $SMTPDebug = false;
  40.     public $Debugoutput = "echo";
  41.     public $SMTPKeepAlive = false;
  42.     public $SingleTo = false;
  43.     public $SingleToArray = array();
  44.     public $LE = "
  45. ";
  46.     public $DKIM_selector = '';
  47.     public $DKIM_identity = '';
  48.     public $DKIM_passphrase = '';
  49.     public $DKIM_domain = '';
  50.     public $DKIM_private = '';
  51.     public $action_function = '';
  52.     public $Version = '5.2.2';
  53.     public $XMailer = '';
  54.     protected $smtp = null;
  55.     protected $to = array();
  56.     protected $cc = array();
  57.     protected $bcc = array();
  58.     protected $ReplyTo = array();
  59.     protected $all_recipients = array();
  60.     protected $attachment = array();
  61.     protected $CustomHeader = array();
  62.     protected $message_type = '';
  63.     protected $boundary = array();
  64.     protected $language = array();
  65.     protected $error_count = 0;
  66.     protected $sign_cert_file = '';
  67.     protected $sign_key_file = '';
  68.     protected $sign_key_pass = '';
  69.     protected $exceptions = false;
  70.     const STOP_MESSAGE = 0;
  71.     const STOP_CONTINUE = 1;
  72.     const STOP_CRITICAL = 2;
  73.     const CRLF = "
  74. ";
  75.     private function mail_passthru($to, $subject, $body, $header, $params) {
  76.         if (ini_get('safe_mode') || !($this->UseSendmailOptions)) {
  77.             $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($subject)), $body, $header);
  78.         } else {
  79.             $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($subject)), $body, $header, $params);
  80.         }
  81.         return $rt;
  82.     }
  83.     private function edebug($str) {
  84.         if ($this->Debugoutput == "error_log") {
  85.             error_log($str);
  86.         } else {
  87.             echo $str;
  88.         }
  89.     }
  90.     public function __construct($exceptions = false) {
  91.         $this->exceptions = ($exceptions == true);
  92.     }
  93.     public function IsHTML($ishtml = true) {
  94.         if ($ishtml) {
  95.             $this->ContentType = 'text/html';
  96.         } else {
  97.             $this->ContentType = 'text/plain';
  98.         }
  99.     }
  100.     public function IsSMTP() {
  101.         $this->Mailer = 'smtp';
  102.     }
  103.     public function IsMail() {
  104.         $this->Mailer = 'mail';
  105.     }
  106.     public function IsSendmail() {
  107.         if (!stristr(ini_get('sendmail_path'), 'sendmail')) {
  108.             $this->Sendmail = '/var/qmail/bin/sendmail';
  109.         }
  110.         $this->Mailer = 'sendmail';
  111.     }
  112.     public function IsQmail() {
  113.         if (stristr(ini_get('sendmail_path'), 'qmail')) {
  114.             $this->Sendmail = '/var/qmail/bin/sendmail';
  115.         }
  116.         $this->Mailer = 'sendmail';
  117.     }
  118.     public function AddAddress($address, $name = '') {
  119.         return $this->AddAnAddress('to', $address, $name);
  120.     }
  121.     public function AddCC($address, $name = '') {
  122.         return $this->AddAnAddress('cc', $address, $name);
  123.     }
  124.     public function AddBCC($address, $name = '') {
  125.         return $this->AddAnAddress('bcc', $address, $name);
  126.     }
  127.     public function AddReplyTo($address, $name = '') {
  128.         return $this->AddAnAddress('Reply-To', $address, $name);
  129.     }
  130.     protected function AddAnAddress($kind, $address, $name = '') {
  131.         if (!preg_match('/^(to|cc|bcc|Reply-To)$/', $kind)) {
  132.             $this->SetError($this->Lang('Invalid recipient array') . ': ' . $kind);
  133.             if ($this->exceptions) {
  134.                 throw new phpmailerException('Invalid recipient array: ' . $kind);
  135.             }
  136.             if ($this->SMTPDebug) {
  137.                 $this->edebug($this->Lang('Invalid recipient array') . ': ' . $kind);
  138.             }
  139.             return false;
  140.         }
  141.         $address = trim($address);
  142.         $name = trim(preg_replace('/[
  143. ]+/', '', $name));
  144.         if (!$this->ValidateAddress($address)) {
  145.             $this->SetError($this->Lang('invalid_address') . ': ' . $address);
  146.             if ($this->exceptions) {
  147.                 throw new phpmailerException($this->Lang('invalid_address') . ': ' . $address);
  148.             }
  149.             if ($this->SMTPDebug) {
  150.                 $this->edebug($this->Lang('invalid_address') . ': ' . $address);
  151.             }
  152.             return false;
  153.         }
  154.         if ($kind != 'Reply-To') {
  155.             if (!isset($this->all_recipients[strtolower($address) ])) {
  156.                 array_push($this->$kind, array($address, $name));
  157.                 $this->all_recipients[strtolower($address) ] = true;
  158.                 return true;
  159.             }
  160.         } else {
  161.             if (!array_key_exists(strtolower($address), $this->ReplyTo)) {
  162.                 $this->ReplyTo[strtolower($address) ] = array($address, $name);
  163.                 return true;
  164.             }
  165.         }
  166.         return false;
  167.     }
  168.     public function SetFrom($address, $name = '', $auto = 1) {
  169.         $address = trim($address);
  170.         $name = trim(preg_replace('/[
  171. ]+/', '', $name));
  172.         if (!$this->ValidateAddress($address)) {
  173.             $this->SetError($this->Lang('invalid_address') . ': ' . $address);
  174.             if ($this->exceptions) {
  175.                 throw new phpmailerException($this->Lang('invalid_address') . ': ' . $address);
  176.             }
  177.             if ($this->SMTPDebug) {
  178.                 $this->edebug($this->Lang('invalid_address') . ': ' . $address);
  179.             }
  180.             return false;
  181.         }
  182.         $this->From = $address;
  183.         $this->FromName = $name;
  184.         if ($auto) {
  185.             if (empty($this->ReplyTo)) {
  186.                 $this->AddAnAddress('Reply-To', $address, $name);
  187.             }
  188.             if (empty($this->Sender)) {
  189.                 $this->Sender = $address;
  190.             }
  191.         }
  192.         return true;
  193.     }
  194.     public static function ValidateAddress($address) {
  195.         return preg_match('/^(?!(?>(?1)"?(?>\[ -~]|[^"])"?(?1)){255,})(?!(?>(?1)"?(?>\[ -~]|[^"])"?(?1)){65,}@)((?>(?>(?>((?>(?>(?>
  196. )?[  ])+|(?>[    ]*
  197. )?[  ]+)?)(\((?>(?2)(?>[- -\'*-\[\]-]|\[
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement