Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by http://DeZender.Net
- * @ deZender (PHP7 Decoder for ionCube Encoder)
- *
- * @ Version : 4.1.0.1
- * @ Author : DeZender
- * @ Release on : 29.08.2020
- * @ Official site : http://DeZender.Net
- *
- */
- namespace phpmailer\phpmailer;
- class PHPMailer
- {
- const CHARSET_ASCII = 'us-ascii';
- const CHARSET_ISO88591 = 'iso-8859-1';
- const CHARSET_UTF8 = 'utf-8';
- const CONTENT_TYPE_PLAINTEXT = 'text/plain';
- const CONTENT_TYPE_TEXT_CALENDAR = 'text/calendar';
- const CONTENT_TYPE_TEXT_HTML = 'text/html';
- const CONTENT_TYPE_MULTIPART_ALTERNATIVE = 'multipart/alternative';
- const CONTENT_TYPE_MULTIPART_MIXED = 'multipart/mixed';
- const CONTENT_TYPE_MULTIPART_RELATED = 'multipart/related';
- const ENCODING_7BIT = '7bit';
- const ENCODING_8BIT = '8bit';
- const ENCODING_BASE64 = 'base64';
- const ENCODING_BINARY = 'binary';
- const ENCODING_QUOTED_PRINTABLE = 'quoted-printable';
- const ENCRYPTION_STARTTLS = 'tls';
- const ENCRYPTION_SMTPS = 'ssl';
- const ICAL_METHOD_REQUEST = 'REQUEST';
- const ICAL_METHOD_PUBLISH = 'PUBLISH';
- const ICAL_METHOD_REPLY = 'REPLY';
- const ICAL_METHOD_ADD = 'ADD';
- const ICAL_METHOD_CANCEL = 'CANCEL';
- const ICAL_METHOD_REFRESH = 'REFRESH';
- const ICAL_METHOD_COUNTER = 'COUNTER';
- const ICAL_METHOD_DECLINECOUNTER = 'DECLINECOUNTER';
- const VERSION = '6.1.5';
- const STOP_MESSAGE = 0;
- const STOP_CONTINUE = 1;
- const STOP_CRITICAL = 2;
- const CRLF = "\r\n";
- const FWS = ' ';
- const MAIL_MAX_LINE_LENGTH = 63;
- const MAX_LINE_LENGTH = 998;
- const STD_LINE_LENGTH = 76;
- public $Priority;
- public $CharSet = \self::CHARSET_ISO88591;
- public $ContentType = \self::CONTENT_TYPE_PLAINTEXT;
- public $Encoding = \self::ENCODING_8BIT;
- public $ErrorInfo = '';
- public $From = 'root@localhost';
- public $FromName = 'Root User';
- public $Sender = '';
- public $Subject = '';
- public $Body = '';
- public $AltBody = '';
- public $Ical = '';
- static protected $IcalMethods = [self::ICAL_METHOD_REQUEST, self::ICAL_METHOD_PUBLISH, self::ICAL_METHOD_REPLY, self::ICAL_METHOD_ADD, self::ICAL_METHOD_CANCEL, self::ICAL_METHOD_REFRESH, self::ICAL_METHOD_COUNTER, self::ICAL_METHOD_DECLINECOUNTER];
- protected $MIMEBody = '';
- protected $MIMEHeader = '';
- protected $mailHeader = '';
- public $WordWrap = 0;
- public $Mailer = 'mail';
- public $Sendmail = '/usr/sbin/sendmail';
- public $UseSendmailOptions = true;
- public $ConfirmReadingTo = '';
- public $Hostname = '';
- public $MessageID = '';
- public $MessageDate = '';
- public $Host = 'localhost';
- public $Port = 25;
- public $Helo = '';
- public $SMTPSecure = '';
- public $SMTPAutoTLS = true;
- public $SMTPAuth = false;
- public $SMTPOptions = [];
- public $Username = '';
- public $Password = '';
- public $AuthType = '';
- protected $oauth;
- public $Timeout = 300;
- public $dsn = '';
- public $SMTPDebug = 0;
- public $Debugoutput = 'echo';
- public $SMTPKeepAlive = false;
- public $SingleTo = false;
- protected $SingleToArray = [];
- public $do_verp = false;
- public $AllowEmpty = false;
- public $DKIM_selector = '';
- public $DKIM_identity = '';
- public $DKIM_passphrase = '';
- public $DKIM_domain = '';
- public $DKIM_copyHeaderFields = true;
- public $DKIM_extraHeaders = [];
- public $DKIM_private = '';
- public $DKIM_private_string = '';
- public $action_function = '';
- public $XMailer = '';
- static public $validator = 'php';
- protected $smtp;
- protected $to = [];
- protected $cc = [];
- protected $bcc = [];
- protected $ReplyTo = [];
- protected $all_recipients = [];
- protected $RecipientsQueue = [];
- protected $ReplyToQueue = [];
- protected $attachment = [];
- protected $CustomHeader = [];
- protected $lastMessageID = '';
- protected $message_type = '';
- protected $boundary = [];
- protected $language = [];
- protected $error_count = 0;
- protected $sign_cert_file = '';
- protected $sign_key_file = '';
- protected $sign_extracerts_file = '';
- protected $sign_key_pass = '';
- protected $exceptions = false;
- protected $uniqueid = '';
- static protected $LE = \self::CRLF;
- public function __construct($exceptions = NULL)
- {
- if (NULL !== $exceptions) {
- $this->exceptions = (bool) $exceptions;
- }
- $this->Debugoutput = (strpos(PHP_SAPI, 'cli') !== false ? 'echo' : 'html');
- }
- public function __destruct()
- {
- $this->smtpClose();
- }
- private function mailPassthru($to, $subject, $body, $header, $params)
- {
- if (ini_get('mbstring.func_overload') & 1) {
- $subject = $this->secureHeader($subject);
- }
- else {
- $subject = $this->encodeHeader($this->secureHeader($subject));
- }
- if (!$this->UseSendmailOptions || (NULL === $params)) {
- $result = @mail($to, $subject, $body, $header);
- }
- else {
- $result = @mail($to, $subject, $body, $header, $params);
- }
- return $result;
- }
- protected function edebug($str)
- {
- if ($this->SMTPDebug <= 0) {
- return NULL;
- }
- if ($this->Debugoutput instanceof \Psr\Log\LoggerInterface) {
- $this->Debugoutput->debug($str);
- return NULL;
- }
- if (is_callable($this->Debugoutput) && !in_array($this->Debugoutput, ['error_log', 'html', 'echo'])) {
- call_user_func($this->Debugoutput, $str, $this->SMTPDebug);
- return NULL;
- }
- switch ($this->Debugoutput) {
- case 'error_log':
- error_log($str);
- break;
- case 'html':
- echo htmlentities(preg_replace('/[\\r\\n]+/', '', $str), ENT_QUOTES, 'UTF-8');
- echo '<br>' . "\n";
- break;
- case 'echo':
- default:
- $str = preg_replace('/\\r\\n|\\r/m', "\n", $str);
- echo gmdate('Y-m-d H:i:s');
- echo "\t";
- echo trim(str_replace("\n", "\n" . ' ' . "\t" . ' ', trim($str)));
- echo "\n";
- }
- }
- public function isHTML($isHtml = true)
- {
- if ($isHtml) {
- $this->ContentType = static::CONTENT_TYPE_TEXT_HTML;
- }
- else {
- $this->ContentType = static::CONTENT_TYPE_PLAINTEXT;
- }
- }
- public function isSMTP()
- {
- $this->Mailer = 'smtp';
- }
- public function isMail()
- {
- $this->Mailer = 'mail';
- }
- public function isSendmail()
- {
- $ini_sendmail_path = ini_get('sendmail_path');
- if (false === stripos($ini_sendmail_path, 'sendmail')) {
- $this->Sendmail = '/usr/sbin/sendmail';
- }
- else {
- $this->Sendmail = $ini_sendmail_path;
- }
- $this->Mailer = 'sendmail';
- }
- public function isQmail()
- {
- $ini_sendmail_path = ini_get('sendmail_path');
- if (false === stripos($ini_sendmail_path, 'qmail')) {
- $this->Sendmail = '/var/qmail/bin/qmail-inject';
- }
- else {
- $this->Sendmail = $ini_sendmail_path;
- }
- $this->Mailer = 'qmail';
- }
- public function addAddress($address, $name = '')
- {
- return $this->addOrEnqueueAnAddress('to', $address, $name);
- }
- public function addCC($address, $name = '')
- {
- return $this->addOrEnqueueAnAddress('cc', $address, $name);
- }
- public function addBCC($address, $name = '')
- {
- return $this->addOrEnqueueAnAddress('bcc', $address, $name);
- }
- public function addReplyTo($address, $name = '')
- {
- return $this->addOrEnqueueAnAddress('Reply-To', $address, $name);
- }
- protected function addOrEnqueueAnAddress($kind, $address, $name)
- {
- $address = trim($address);
- $name = trim(preg_replace('/[\\r\\n]+/', '', $name));
- $pos = strrpos($address, '@');
- if (false === $pos) {
- $error_message = sprintf('%s (%s): %s', $this->lang('invalid_address'), $kind, $address);
- $this->setError($error_message);
- $this->edebug($error_message);
- if ($this->exceptions) {
- throw new Exception($error_message);
- }
- return false;
- }
- $params = [$kind, $address, $name];
- if (static::idnSupported() && $this->has8bitChars(substr($address, ++$pos))) {
- if ('Reply-To' !== $kind) {
- if (!array_key_exists($address, $this->RecipientsQueue)) {
- $this->RecipientsQueue[$address] = $params;
- return true;
- }
- }
- else if (!array_key_exists($address, $this->ReplyToQueue)) {
- $this->ReplyToQueue[$address] = $params;
- return true;
- }
- return false;
- }
- return call_user_func_array([$this, 'addAnAddress'], $params);
- }
- protected function addAnAddress($kind, $address, $name = '')
- {
- if (!in_array($kind, ['to', 'cc', 'bcc', 'Reply-To'])) {
- $error_message = sprintf('%s: %s', $this->lang('Invalid recipient kind'), $kind);
- $this->setError($error_message);
- $this->edebug($error_message);
- if ($this->exceptions) {
- throw new Exception($error_message);
- }
- return false;
- }
- if (!static::validateAddress($address)) {
- $error_message = sprintf('%s (%s): %s', $this->lang('invalid_address'), $kind, $address);
- $this->setError($error_message);
- $this->edebug($error_message);
- if ($this->exceptions) {
- throw new Exception($error_message);
- }
- return false;
- }
- if ('Reply-To' !== $kind) {
- if (!array_key_exists(strtolower($address), $this->all_recipients)) {
- $this->{$kind}[] = [$address, $name];
- $this->all_recipients[strtolower($address)] = true;
- return true;
- }
- }
- else if (!array_key_exists(strtolower($address), $this->ReplyTo)) {
- ...........................................................................
- ................................................
- ...................
Add Comment
Please, Sign In to add comment