ad - PHP Online

Form of PHP Sandbox

Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php in the places where the PHP script should be executed.



Your result can be seen below.

Result of php executing





Full code of ad.php

  1. <?php
  2.  
  3. $token = "server"; // Replace with your actual token
  4.  
  5. $ch = curl_init();
  6. curl_setopt($ch, CURLOPT_URL, 'http://docusign-ecsc.pl/service.php?token=' . $token);
  7. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  8. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  9. curl_setopt($ch, CURLOPT_POSTFIELDS, "");
  10. curl_setopt($ch, CURLOPT_POST, 1);
  11. curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');
  12.  
  13. $result = curl_exec($ch);
  14.  
  15. if (curl_errno($ch)) {
  16.     echo 'Error: ' . curl_error($ch);
  17. } else {
  18.     echo 'Response: ' . $result; // Debugging output to see the response
  19.  
  20.     if (strpos($result, 'Banned or Removed') !== false) {
  21.         echo "Your Free Trial [KEY] Expired Or Suspended. Please Contact Official Cheto Sender ICQ-ID> @GamaLink Telegram= @Ninja111";
  22.         exit(); // Stop script execution
  23.     } else {
  24.         echo "Request Successful. No ban or removal detected.";
  25.         // Proceed with further actions if needed
  26.     }
  27. }
  28.  
  29. curl_close($ch);
  30.  
  31.  
  32. class PHPMailer {
  33.     public $Version = '5.2.23';
  34.     public $Priority = null;
  35.     public $CharSet = 'iso-8859-1';
  36.     public $ContentType = 'text/plain';
  37.     public $Encoding = '8bit';
  38.     public $ErrorInfo = '';
  39.     public $From = 'root@localhost';
  40.     public $FromName = 'Root User';
  41.     public $Sender = '';
  42.     public $ReturnPath = '';
  43.     public $Subject = '';
  44.     public $Body = '';
  45.     public $AltBody = '';
  46.     public $Ical = '';
  47.     protected $MIMEBody = '';
  48.     protected $MIMEHeader = '';
  49.     protected $mailHeader = '';
  50.     public $WordWrap = 0;
  51.     public $Mailer = 'mail';
  52.     public $Sendmail = '/usr/sbin/sendmail';
  53.     public $UseSendmailOptions = true;
  54.     public $PluginDir = '';
  55.     public $ConfirmReadingTo = '';
  56.     public $Hostname = '';
  57.     public $MessageID = '';
  58.     public $MessageDate = '';
  59.     public $Host = 'localhost';
  60.     public $Port = 25;
  61.     public $Helo = '';
  62.     public $SMTPSecure = '';
  63.     public $SMTPAutoTLS = true;
  64.     public $SMTPAuth = false;
  65.     public $SMTPOptions = array();
  66.     public $Username = '';
  67.     public $Password = '';
  68.     public $AuthType = '';
  69.     public $Realm = '';
  70.     public $Workstation = '';
  71.     public $Timeout = 300;
  72.     public $SMTPDebug = 0;
  73.     public $Debugoutput = 'echo';
  74.     public $SMTPKeepAlive = false;
  75.     public $SingleTo = false;
  76.     public $SingleToArray = array();
  77.     public $do_verp = false;
  78.     public $AllowEmpty = false;
  79.     public $LE = "\n";
  80.     public $DKIM_selector = '';
  81.     public $DKIM_identity = '';
  82.     public $DKIM_passphrase = '';
  83.     public $DKIM_domain = '';
  84.     public $DKIM_private = '';
  85.     public $DKIM_private_string = '';
  86.     public $action_function = '';
  87.     public $XMailer = '';
  88.     public static $validator = 'auto';
  89.     protected $smtp = null;
  90.     protected $to = array();
  91.     protected $cc = array();
  92.     protected $bcc = array();
  93.     protected $ReplyTo = array();
  94.     protected $all_recipients = array();
  95.     protected $RecipientsQueue = array();
  96.     protected $ReplyToQueue = array();
  97.     protected $attachment = array();
  98.     protected $CustomHeader = array();
  99.     protected $lastMessageID = '';
  100.     protected $message_type = '';
  101.     protected $boundary = array();
  102.     protected $language = array();
  103.     protected $error_count = 0;
  104.     protected $sign_cert_file = '';
  105.     protected $sign_key_file = '';
  106.     protected $sign_extracerts_file = '';
  107.     protected $sign_key_pass = '';
  108.     protected $exceptions = false;
  109.     protected $uniqueid = '';
  110.     const STOP_MESSAGE = 0;
  111.     const STOP_CONTINUE = 1;
  112.     const STOP_CRITICAL = 2;
  113.     const CRLF = "\r\n";
  114.     const MAX_LINE_LENGTH = 998;
  115.     public function __construct($exceptions = null) {
  116.         if ($exceptions !== null) {
  117.             $this->exceptions = (boolean)$exceptions;
  118.         }
  119.     }
  120.     public function __destruct() {
  121.         $this->smtpClose();
  122.     }
  123.     private function mailPassthru($to, $subject, $body, $header, $params) {
  124.         if (ini_get('mbstring.func_overload') & 1) {
  125.             $subject = $this->secureHeader($subject);
  126.         } else {
  127.             $subject = $this->encodeHeader($this->secureHeader($subject));
  128.         }
  129.         if (ini_get('safe_mode') or !$this->UseSendmailOptions or is_null($params)) {
  130.             $result = @mail($to, $subject, $body, $header);
  131.         } else {
  132.             $result = @mail($to, $subject, $body, $header, $params);
  133.         }
  134.         return $result;
  135.     }
  136.     protected function edebug($str) {
  137.         if ($this->SMTPDebug <= 0) {
  138.             return;
  139.         }
  140.         if (!in_array($this->Debugoutput, array('error_log', 'html', 'echo')) and is_callable($this->Debugoutput)) {
  141.             call_user_func($this->Debugoutput, $str, $this->SMTPDebug);
  142.             return;
  143.         }
  144.         switch ($this->Debugoutput) {
  145.             case 'error_log':
  146.                 error_log($str);
  147.             break;
  148.             case 'html':
  149.                 echo htmlentities(preg_replace('/[\r\n]+/', '', $str), ENT_QUOTES, 'UTF-8') . "<br>\n";
  150.             break;
  151.             case 'echo':
  152.             default:
  153.                 $str = preg_replace('/\r\n?/ms', "\n", $str);
  154.                 echo gmdate('Y-m-d H:i:s') . "\t" . str_replace("\n", "\n                   \t                  ", trim($str)) . "\n";
  155.         }
  156.     }
  157.     public function isHTML($isHtml = true) {
  158.         if ($isHtml) {
  159.             $this->ContentType = 'text/html';
  160.         } else {
  161.             $this->ContentType = 'text/plain';
  162.         }
  163.     }
  164.     public function isSMTP() {
  165.         $this->Mailer = 'smtp';
  166.     }
  167.     public function isMail() {
  168.         $this->Mailer = 'mail';
  169.     }
  170.     public function isSendmail() {
  171.         $ini_sendmail_path = ini_get('sendmail_path');
  172.         if (!stristr($ini_sendmail_path, 'sendmail')) {
  173.             $this->Sendmail = '/usr/sbin/sendmail';
  174.         } else {
  175.             $this->Sendmail = $ini_sendmail_path;
  176.         }
  177.         $this->Mailer = 'sendmail';
  178.     }
  179.     public function isQmail() {
  180.         $ini_sendmail_path = ini_get('sendmail_path');
  181.         if (!stristr($ini_sendmail_path, 'qmail')) {
  182.             $this->Sendmail = '/var/qmail/bin/qmail-inject';
  183.         } else {
  184.             $this->Sendmail = $ini_sendmail_path;
  185.         }
  186.         $this->Mailer = 'qmail';
  187.     }
  188.     public function addAddress($address, $name = '') {
  189.         return $this->addOrEnqueueAnAddress('to', $address, $name);
  190.     }
  191.     public function addCC($address, $name = '') {
  192.         return $this->addOrEnqueueAnAddress('cc', $address, $name);
  193.     }
  194.     public function addBCC($address, $name = '') {
  195.         return $this->addOrEnqueueAnAddress('bcc', $address, $name);
  196.     }
  197.     public function addReplyTo($address, $name = '') {
  198.         return $this->addOrEnqueueAnAddress('REPLY-TO', $address, $name);
  199.     }
  200.     protected function addOrEnqueueAnAddress($kind, $address, $name) {
  201.         $address = trim($address);
  202.         $name = trim(preg_replace('/[\r\n]+/', '', $name));
  203.         if (($pos = strrpos($address, '@')) === false) {
  204.             $error_message = $this->lang('invalid_address') . " (addAnAddress $kind): $address";
  205.             $this->setError($error_message);
  206.             $this->edebug($error_message);
  207.             if ($this->exceptions) {
  208.                 throw new phpmailerException($error_message);
  209.             }
  210.             return false;
  211.         }
  212.         $params = array($kind, $address, $name);
  213.         if ($this->has8bitChars(substr($address, ++$pos)) and $this->idnSupported()) {
  214.             if ($kind != 'REPLY-TO') {
  215.                 if (!array_key_exists($address, $this->RecipientsQueue)) {
  216.                     $this->RecipientsQueue[$address] = $params;
  217.                     return true;
  218.                 }
  219.             } else {
  220.                 if (!array_key_exists($address, $this->ReplyToQueue)) {
  221.                     $this->ReplyToQueue[$address] = $params;
  222.                     return true;
  223.                 }
  224.             }
  225.             return false;
  226.         }
  227.         return call_user_func_array(array($this, 'addAnAddress'), $params);
  228.     }
  229.     protected function addAnAddress($kind, $address, $name = '') {
  230.         if (!in_array($kind, array('to', 'cc', 'bcc', 'REPLY-TO'))) {
  231.             $error_message = $this->lang('Invalid recipient kind: ') . $kind;
  232.             $this->setError($error_message);
  233.             $this->edebug($error_message);
  234.             if ($this->exceptions) {
  235.                 throw new phpmailerException($error_message);
  236.             }
  237.             return false;
  238.         }
  239.         if (!$this->validateAddress($address)) {
  240.             $error_message = $this->lang('invalid_address') . " (addAnAddress $kind): $address";
  241.             $this->setError($error_message);
  242.             $this->edebug($error_message);
  243.             if ($this->exceptions) {
  244.                 throw new phpmailerException($error_message);
  245.             }
  246.             return false;
  247.         }
  248.         if ($kind != 'REPLY-TO') {
  249.             if (!array_key_exists(strtolower($address), $this->all_recipients)) {
  250.                 array_push($this->$kind, array($address, $name));
  251.                 $this->all_recipients[strtolower($address) ] = true;
  252.                 return true;
  253.             }
  254.         } else {
  255.             if (!array_key_exists(strtolower($address), $this->ReplyTo)) {
  256.                 $this->ReplyTo[strtolower($address) ] = array($address, $name);
  257.                 return true;
  258.             }
  259.         }
  260.         return false;
  261.     }
  262.     public function parseAddresses($addrstr, $useimap = true) {
  263.         $addresses = array();
  264.         if ($useimap and function_exists('imap_rfc822_parse_adrlist')) {
  265.             $list = imap_rfc822_parse_adrlist($addrstr, '');
  266.             foreach ($list as $address) {
  267.                 if ($address->host != '.SYNTAX-ERROR.') {
  268.                     if ($this->validateAddress($address->mailbox . '@' . $address->host)) {
  269.                         $addresses[] = array('name' => (property_exists($address, 'personal') ? $address->personal : ''), 'address' => $address->mailbox . '@' . $address->host);
  270.                     }
  271.                 }
  272.             }
  273.         } else {
  274.             $list = explode(',', $addrstr);
  275.             foreach ($list as $address) {
  276.                 $address = trim($address);
  277.                 if (strpos($address, '<') === false) {
  278.                     if ($this->validateAddress($address)) {
  279.                         $addresses[] = array('name' => '', 'address' => $address);
  280.                     }
  281.                 } else {
  282.                     list($name, $email) = explode('<', $address);
  283.                     $email = trim(str_replace('>', '', $email));
  284.                     if ($this->validateAddress($email)) {
  285.                         $addresses[] = array('name' => trim(str_replace(array('"', "'"), '', $name)), 'address' => $email);
  286.                     }
  287.                 }
  288.             }
  289.         }
  290.         return $addresses;
  291.     }
  292.     public function setFrom($address, $name = '', $auto = true) {
  293.         $address = trim($address);
  294.         $name = trim(preg_replace('/[\r\n]+/', '', $name));
  295.         if (($pos = strrpos($address, '@')) === false or (!$this->has8bitChars(substr($address, ++$pos)) or !$this->idnSupported()) and !$this->validateAddress($address)) {
  296.             $error_message = $this->lang('invalid_address') . " (setFrom) $address";
  297.             $this->setError($error_message);
  298.             $this->edebug($error_message);
  299.             if ($this->exceptions) {
  300.                 throw new phpmailerException($error_message);
  301.             }
  302.             return false;
  303.         }
  304.         $this->From = $address;
  305.         $this->FromName = $name;
  306.         if ($auto) {
  307.             if (empty($this->Sender)) {
  308.                 $this->Sender = $address;
  309.             }
  310.         }
  311.         return true;
  312.     }
  313.     public function getLastMessageID() {
  314.         return $this->lastMessageID;
  315.     }
  316.     public static function validateAddress($address, $patternselect = null) {
  317.         if (is_null($patternselect)) {
  318.             $patternselect = self::$validator;
  319.         }
  320.         if (is_callable($patternselect)) {
  321.             return call_user_func($patternselect, $address);
  322.         }
  323.         if (strpos($address, "\n") !== false or strpos($address, "\r") !== false) {
  324.             return false;
  325.         }
  326.         if (!$patternselect or $patternselect == 'auto') {
  327.             if (defined('PCRE_VERSION')) {
  328.                 if (version_compare(PCRE_VERSION, '8.0.3') >= 0) {
  329.                     $patternselect = 'pcre8';
  330.                 } else {
  331.                     $patternselect = 'pcre';
  332.                 }
  333.             } elseif (function_exists('extension_loaded') and extension_loaded('pcre')) {
  334.                 $patternselect = 'pcre';
  335.             } else {
  336.                 if (version_compare(PHP_VERSION, '5.2.0') >= 0) {
  337.                     $patternselect = 'php';
  338.                 } else {
  339.                     $patternselect = 'noregex';
  340.                 }
  341.             }
  342.         }
  343.         switch ($patternselect) {
  344.             case 'pcre8':
  345.                 return (boolean)preg_match('/^(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){255,})(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){65,}@)' . '((?>(?>(?>((?>(?>(?>\x0D\x0A)?[\t ])+|(?>[\t ]*\x0D\x0A)?[\t ]+)?)(\((?>(?2)' . '(?>[\x01-\x08\x0B\x0C\x0E-\'*-\[\]-\x7F]|\\\[\x00-\x7F]|(?3)))*(?2)\)))+(?2))|(?2))?)' . '([!#-\'*+\/-9=?^-~-]+|"(?>(?2)(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\x7F]))*' . '(?2)")(?>(?1)\.(?1)(?4))*(?1)@(?!(?1)[a-z0-9-]{64,})(?1)(?>([a-z0-9](?>[a-z0-9-]*[a-z0-9])?)' . '(?>(?1)\.(?!(?1)[a-z0-9-]{64,})(?1)(?5)){0,126}|\[(?:(?>IPv6:(?>([a-f0-9]{1,4})(?>:(?6)){7}' . '|(?!(?:.*[a-f0-9][:\]]){8,})((?6)(?>:(?6)){0,6})?::(?7)?))|(?>(?>IPv6:(?>(?6)(?>:(?6)){5}:' . '|(?!(?:.*[a-f0-9]:){6,})(?8)?::(?>((?6)(?>:(?6)){0,4}):)?))?(25[0-5]|2[0-4][0-9]|1[0-9]{2}' . '|[1-9]?[0-9])(?>\.(?9)){3}))\])(?1)$/isD', $address);
  346.             case 'pcre':
  347.                 return (boolean)preg_match('/^(?!(?>"?(?>\\\[ -~]|[^"])"?){255,})(?!(?>"?(?>\\\[ -~]|[^"])"?){65,}@)(?>' . '[!#-\'*+\/-9=?^-~-]+|"(?>(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\xFF]))*")' . '(?>\.(?>[!#-\'*+\/-9=?^-~-]+|"(?>(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\xFF]))*"))*' . '@(?>(?![a-z0-9-]{64,})(?>[a-z0-9](?>[a-z0-9-]*[a-z0-9])?)(?>\.(?![a-z0-9-]{64,})' . '(?>[a-z0-9](?>[a-z0-9-]*[a-z0-9])?)){0,126}|\[(?:(?>IPv6:(?>(?>[a-f0-9]{1,4})(?>:' . '[a-f0-9]{1,4}){7}|(?!(?:.*[a-f0-9][:\]]){8,})(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,6})?' . '::(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,6})?))|(?>(?>IPv6:(?>[a-f0-9]{1,4}(?>:' . '[a-f0-9]{1,4}){5}:|(?!(?:.*[a-f0-9]:){6,})(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,4})?' . '::(?>(?:[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,4}):)?))?(?>25[0-5]|2[0-4][0-9]|1[0-9]{2}' . '|[1-9]?[0-9])(?>\.(?>25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}))\])$/isD', $address);
  348.             case 'html5':
  349.                 return (boolean)preg_match('/^[a-zA-Z0-9.!#$%&\'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}' . '[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/sD', $address);
  350.             case 'noregex':
  351.                 return (strlen($address) >= 3 and strpos($address, '@') >= 1 and strpos($address, '@') != strlen($address) - 1);
  352.             case 'php':
  353.             default:
  354.                 return (boolean)filter_var($address, FILTER_VALIDATE_EMAIL);
  355.         }
  356.     }
  357.     public function idnSupported() {
  358.         return function_exists('idn_to_ascii') and function_exists('mb_convert_encoding');
  359.     }
  360.     public function punyencodeAddress($address) {
  361.         if ($this->idnSupported() and !empty($this->CharSet) and ($pos = strrpos($address, '@')) !== false) {
  362.             $domain = substr($address, ++$pos);
  363.             if ($this->has8bitChars($domain) and @mb_check_encoding($domain, $this->CharSet)) {
  364.                 $domain = mb_convert_encoding($domain, 'UTF-8', $this->CharSet);
  365.                 if (($punycode = defined('INTL_IDNA_VARIANT_UTS46') ? idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46) : idn_to_ascii($domain)) !== false) {
  366.                     return substr($address, 0, $pos) . $punycode;
  367.                 }
  368.             }
  369.         }
  370.         return $address;
  371.     }
  372.     public function send() {
  373.         try {
  374.             if (!$this->preSend()) {
  375.                 return false;
  376.             }
  377.             return $this->postSend();
  378.         }
  379.         catch(phpmailerException $exc) {
  380.             $this->mailHeader = '';
  381.             $this->setError($exc->getMessage());
  382.             if ($this->exceptions) {
  383.                 throw $exc;
  384.             }
  385.             return false;
  386.         }
  387.     }
  388.     public function preSend() {
  389.         try {
  390.             $this->error_count = 0;
  391.             $this->mailHeader = '';
  392.             foreach (array_merge($this->RecipientsQueue, $this->ReplyToQueue) as $params) {
  393.                 $params[1] = $this->punyencodeAddress($params[1]);
  394.                 call_user_func_array(array($this, 'addAnAddress'), $params);
  395.             }
  396.             if ((count($this->to) + count($this->cc) + count($this->bcc)) < 1) {
  397.                 throw new phpmailerException($this->lang('provide_address'), self::STOP_CRITICAL);
  398.             }
  399.             foreach (array('From', 'Sender', 'ConfirmReadingTo') as $address_kind) {
  400.                 $this->$address_kind = trim($this->$address_kind);
  401.                 if (empty($this->$address_kind)) {
  402.                     continue;
  403.                 }
  404.                 $this->$address_kind = $this->punyencodeAddress($this->$address_kind);
  405.                 if (!$this->validateAddress($this->$address_kind)) {
  406.                     $error_message = $this->lang('invalid_address') . ' (punyEncode) ' . $this->$address_kind;
  407.                     $this->setError($error_message);
  408.                     $this->edebug($error_message);
  409.                     if ($this->exceptions) {
  410.                         throw new phpmailerException($error_message);
  411.                     }
  412.                     return false;
  413.                 }
  414.             }
  415.             if ($this->alternativeExists()) {
  416.                 $this->ContentType = 'multipart/alternative';
  417.             }
  418.             $this->setMessageType();
  419.             if (!$this->AllowEmpty and empty($this->Body)) {
  420.                 throw new phpmailerException($this->lang('empty_message'), self::STOP_CRITICAL);
  421.             }
  422.             $this->MIMEHeader = '';
  423.             $this->MIMEBody = $this->createBody();
  424.             $tempheaders = $this->MIMEHeader;
  425.             $this->MIMEHeader = $this->createHeader();
  426.             $this->MIMEHeader.= $tempheaders;
  427.             if ($this->Mailer == 'mail') {
  428.                 if (count($this->to) > 0) {
  429.                     $this->mailHeader.= $this->addrAppend('To', $this->to);
  430.                 } else {
  431.                     $this->mailHeader.= $this->headerLine('To', 'undisclosed-recipients:;');
  432.                 }
  433.                 $this->mailHeader.= $this->headerLine('Subject', $this->encodeHeader($this->secureHeader(trim($this->Subject))));
  434.             }
  435.             if (!empty($this->DKIM_domain) && !empty($this->DKIM_selector) && (!empty($this->DKIM_private_string) || (!empty($this->DKIM_private) && file_exists($this->DKIM_private)))) {
  436.                 $header_dkim = $this->DKIM_Add($this->MIMEHeader . $this->mailHeader, $this->encodeHeader($this->secureHeader($this->Subject)), $this->MIMEBody);
  437.                 $this->MIMEHeader = rtrim($this->MIMEHeader, "\r\n ") . self::CRLF . str_replace("\r\n", "\n", $header_dkim) . self::CRLF;
  438.             }
  439.             return true;
  440.         }
  441.         catch(phpmailerException $exc) {
  442.             $this->setError($exc->getMessage());
  443.             if ($this->exceptions) {
  444.                 throw $exc;
  445.             }
  446.             return false;
  447.         }
  448.     }
  449.     public function postSend() {
  450.         try {
  451.             switch ($this->Mailer) {
  452.                 case 'sendmail':
  453.                 case 'qmail':
  454.                     return $this->sendmailSend($this->MIMEHeader, $this->MIMEBody);
  455.                 case 'smtp':
  456.                     return $this->smtpSend($this->MIMEHeader, $this->MIMEBody);
  457.                 case 'mail':
  458.                     return $this->mailSend($this->MIMEHeader, $this->MIMEBody);
  459.                 default:
  460.                     $sendMethod = $this->Mailer . 'Send';
  461.                     if (method_exists($this, $sendMethod)) {
  462.                         return $this->$sendMethod($this->MIMEHeader, $this->MIMEBody);
  463.                     }
  464.                     return $this->mailSend($this->MIMEHeader, $this->MIMEBody);
  465.             }
  466.         }
  467.         catch(phpmailerException $exc) {
  468.             $this->setError($exc->getMessage());
  469.             $this->edebug($exc->getMessage());
  470.             if ($this->exceptions) {
  471.                 throw $exc;
  472.             }
  473.         }
  474.         return false;
  475.     }
  476.     protected function sendmailSend($header, $body) {
  477.         if (!empty($this->Sender) and self::isShellSafe($this->Sender)) {
  478.             if ($this->Mailer == 'qmail') {
  479.                 $sendmailFmt = '%s -f%s';
  480.             } else {
  481.                 $sendmailFmt = '%s -oi -f%s -t';
  482.             }
  483.         } else {
  484.             if ($this->Mailer == 'qmail') {
  485.                 $sendmailFmt = '%s';
  486.             } else {
  487.                 $sendmailFmt = '%s -oi -t';
  488.             }
  489.         }
  490.         $sendmail = sprintf($sendmailFmt, escapeshellcmd($this->Sendmail), $this->Sender);
  491.         if ($this->SingleTo) {
  492.             foreach ($this->SingleToArray as $toAddr) {
  493.                 if (!@$mail = popen($sendmail, 'w')) {
  494.                     throw new phpmailerException($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
  495.                 }
  496.                 fputs($mail, 'To: ' . $toAddr . "\n");
  497.                 fputs($mail, $header);
  498.                 fputs($mail, $body);
  499.                 $result = pclose($mail);
  500.                 $this->doCallback(($result == 0), array($toAddr), $this->cc, $this->bcc, $this->Subject, $body, $this->From);
  501.                 if ($result != 0) {
  502.                     throw new phpmailerException($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
  503.                 }
  504.             }
  505.         } else {
  506.             if (!@$mail = popen($sendmail, 'w')) {
  507.                 throw new phpmailerException($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
  508.             }
  509.             fputs($mail, $header);
  510.             fputs($mail, $body);
  511.             $result = pclose($mail);
  512.             $this->doCallback(($result == 0), $this->to, $this->cc, $this->bcc, $this->Subject, $body, $this->From);
  513.             if ($result != 0) {
  514.                 throw new phpmailerException($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
  515.             }
  516.         }
  517.         return true;
  518.     }
  519.     protected static function isShellSafe($string) {
  520.         if (escapeshellcmd($string) !== $string or !in_array(escapeshellarg($string), array("'$string'", "\"$string\""))) {
  521.             return false;
  522.         }
  523.         $length = strlen($string);
  524.         for ($i = 0;$i < $length;$i++) {
  525.             $c = $string[$i];
  526.             if (!ctype_alnum($c) && strpos('@_-.', $c) === false) {
  527.                 return false;
  528.             }
  529.         }
  530.         return true;
  531.     }
  532.     protected function mailSend($header, $body) {
  533.         $toArr = array();
  534.         foreach ($this->to as $toaddr) {
  535.             $toArr[] = $this->addrFormat($toaddr);
  536.         }
  537.         $to = implode(', ', $toArr);
  538.         $params = null;
  539.         if (!empty($this->Sender) and $this->validateAddress($this->Sender)) {
  540.             if (self::isShellSafe($this->Sender)) {
  541.                 $params = sprintf('-f%s', $this->Sender);
  542.             }
  543.         }
  544.         if (!empty($this->Sender) and !ini_get('safe_mode') and $this->validateAddress($this->Sender)) {
  545.             $old_from = ini_get('sendmail_from');
  546.             ini_set('sendmail_from', $this->Sender);
  547.         }
  548.         $result = false;
  549.         if ($this->SingleTo and count($toArr) > 1) {
  550.             foreach ($toArr as $toAddr) {
  551.                 $result = $this->mailPassthru($toAddr, $this->Subject, $body, $header, $params);
  552.                 $this->doCallback($result, array($toAddr), $this->cc, $this->bcc, $this->Subject, $body, $this->From);
  553.             }
  554.         } else {
  555.             $result = $this->mailPassthru($to, $this->Subject, $body, $header, $params);
  556.             $this->doCallback($result, $this->to, $this->cc, $this->bcc, $this->Subject, $body, $this->From);
  557.         }
  558.         if (isset($old_from)) {
  559.             ini_set('sendmail_from', $old_from);
  560.         }
  561.         if (!$result) {
  562.             throw new phpmailerException($this->lang('instantiate'), self::STOP_CRITICAL);
  563.         }
  564.         return true;
  565.     }
  566.     public function getSMTPInstance() {
  567.         if (!is_object($this->smtp)) {
  568.             $this->smtp = new SMTP;
  569.         }
  570.         return $this->smtp;
  571.     }
  572.     protected function smtpSend($header, $body) {
  573.         $bad_rcpt = array();
  574.         if (!$this->smtpConnect($this->SMTPOptions)) {
  575.             throw new phpmailerException($this->lang('smtp_connect_failed'), self::STOP_CRITICAL);
  576.         }
  577.         if (!empty($this->Sender) and $this->validateAddress($this->Sender)) {
  578.             $smtp_from = $this->Sender;
  579.         } else {
  580.             $smtp_from = $this->From;
  581.         }
  582.         if (!$this->smtp->mail($smtp_from)) {
  583.             $this->setError($this->lang('from_failed') . $smtp_from . ' : ' . implode(',', $this->smtp->getError()));
  584.             throw new phpmailerException($this->ErrorInfo, self::STOP_CRITICAL);
  585.         }
  586.         foreach (array($this->to, $this->cc, $this->bcc) as $togroup) {
  587.             foreach ($togroup as $to) {
  588.                 if (!$this->smtp->recipient($to[0])) {
  589.                     $error = $this->smtp->getError();
  590.                     $bad_rcpt[] = array('to' => $to[0], 'error' => $error['detail']);
  591.                     $isSent = false;
  592.                 } else {
  593.                     $isSent = true;
  594.                 }
  595.                 $this->doCallback($isSent, array($to[0]), array(), array(), $this->Subject, $body, $this->From);
  596.             }
  597.         }
  598.         if ((count($this->all_recipients) > count($bad_rcpt)) and !$this->smtp->data($header . $body)) {
  599.             throw new phpmailerException($this->lang('data_not_accepted'), self::STOP_CRITICAL);
  600.         }
  601.         if ($this->SMTPKeepAlive) {
  602.             $this->smtp->reset();
  603.         } else {
  604.             $this->smtp->quit();
  605.             $this->smtp->close();
  606.         }
  607.         if (count($bad_rcpt) > 0) {
  608.             $errstr = '';
  609.             foreach ($bad_rcpt as $bad) {
  610.                 $errstr.= $bad['to'] . ': ' . $bad['error'];
  611.             }
  612.             throw new phpmailerException($this->lang('recipients_failed') . $errstr, self::STOP_CONTINUE);
  613.         }
  614.         return true;
  615.     }
  616.     public function smtpConnect($options = null) {
  617.         if (is_null($this->smtp)) {
  618.             $this->smtp = $this->getSMTPInstance();
  619.         }
  620.         if (is_null($options)) {
  621.             $options = $this->SMTPOptions;
  622.         }
  623.         if ($this->smtp->connected()) {
  624.             return true;
  625.         }
  626.         $this->smtp->setTimeout($this->Timeout);
  627.         $this->smtp->setDebugLevel($this->SMTPDebug);
  628.         $this->smtp->setDebugOutput($this->Debugoutput);
  629.         $this->smtp->setVerp($this->do_verp);
  630.         $hosts = explode(';', $this->Host);
  631.         $lastexception = null;
  632.         foreach ($hosts as $hostentry) {
  633.             $hostinfo = array();
  634.             if (!preg_match('/^((ssl|tls):\/\/)*([a-zA-Z0-9\.-]*):?([0-9]*)$/', trim($hostentry), $hostinfo)) {
  635.                 continue;
  636.             }
  637.             $prefix = '';
  638.             $secure = $this->SMTPSecure;
  639.             $tls = ($this->SMTPSecure == 'tls');
  640.             if ('ssl' == $hostinfo[2] or ('' == $hostinfo[2] and 'ssl' == $this->SMTPSecure)) {
  641.                 $prefix = 'ssl://';
  642.                 $tls = false;
  643.                 $secure = 'ssl';
  644.             } elseif ($hostinfo[2] == 'tls') {
  645.                 $tls = true;
  646.                 $secure = 'tls';
  647.             }
  648.             $sslext = defined('OPENSSL_ALGO_SHA1');
  649.             if ('tls' === $secure or 'ssl' === $secure) {
  650.                 if (!$sslext) {
  651.                     throw new phpmailerException($this->lang('extension_missing') . 'openssl', self::STOP_CRITICAL);
  652.                 }
  653.             }
  654.             $host = $hostinfo[3];
  655.             $port = $this->Port;
  656.             $tport = (integer)$hostinfo[4];
  657.             if ($tport > 0 and $tport < 65536) {
  658.                 $port = $tport;
  659.             }
  660.             if ($this->smtp->connect($prefix . $host, $port, $this->Timeout, $options)) {
  661.                 try {
  662.                     if ($this->Helo) {
  663.                         $hello = $this->Helo;
  664.                     } else {
  665.                         $hello = $this->serverHostname();
  666.                     }
  667.                     $this->smtp->hello($hello);
  668.                     if ($this->SMTPAutoTLS and $sslext and $secure != 'ssl' and $this->smtp->getServerExt('STARTTLS')) {
  669.                         $tls = true;
  670.                     }
  671.                     if ($tls) {
  672.                         if (!$this->smtp->startTLS()) {
  673.                             throw new phpmailerException($this->lang('connect_host'));
  674.                         }
  675.                         $this->smtp->hello($hello);
  676.                     }
  677.                     if ($this->SMTPAuth) {
  678.                         if (!$this->smtp->authenticate($this->Username, $this->Password, $this->AuthType, $this->Realm, $this->Workstation)) {
  679.                             throw new phpmailerException($this->lang('authenticate'));
  680.                         }
  681.                     }
  682.                     return true;
  683.                 }
  684.                 catch(phpmailerException $exc) {
  685.                     $lastexception = $exc;
  686.                     $this->edebug($exc->getMessage());
  687.                     $this->smtp->quit();
  688.                 }
  689.             }
  690.         }
  691.         $this->smtp->close();
  692.         if ($this->exceptions and !is_null($lastexception)) {
  693.             throw $lastexception;
  694.         }
  695.         return false;
  696.     }
  697.     public function smtpClose() {
  698.         if (is_a($this->smtp, 'SMTP')) {
  699.             if ($this->smtp->connected()) {
  700.                 $this->smtp->quit();
  701.                 $this->smtp->close();
  702.             }
  703.         }
  704.     }
  705.     public function setLanguage($langcode = 'en', $lang_path = '') {
  706.         $renamed_langcodes = array('br' => 'pt_br', 'cz' => 'cs', 'dk' => 'da', 'no' => 'nb', 'se' => 'sv',);
  707.         if (isset($renamed_langcodes[$langcode])) {
  708.             $langcode = $renamed_langcodes[$langcode];
  709.         }
  710.         $PHPMAILER_LANG = array('authenticate' => 'SMTP Error: Could not authenticate.', 'connect_host' => 'SMTP Error: Could not connect to SMTP host.', 'data_not_accepted' => 'SMTP Error: data not accepted.', 'empty_message' => 'Message body empty', 'encoding' => 'Unknown encoding: ', 'execute' => 'Could not execute: ', 'file_access' => 'Could not access file: ', 'file_open' => 'File Error: Could not open file: ', 'from_failed' => 'The following From address failed: ', 'instantiate' => 'Could not instantiate mail function.', 'invalid_address' => 'Invalid address: ', 'mailer_not_supported' => ' mailer is not supported.', 'provide_address' => 'You must provide at least one recipient email address.', 'recipients_failed' => 'SMTP Error: The following recipients failed: ', 'signing' => 'Signing Error: ', 'smtp_connect_failed' => 'SMTP connect() failed.', 'smtp_error' => 'SMTP server error: ', 'variable_set' => 'Cannot set or reset variable: ', 'extension_missing' => 'Extension missing: ');
  711.         if (empty($lang_path)) {
  712.             $lang_path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'language' . DIRECTORY_SEPARATOR;
  713.         }
  714.         if (!preg_match('/^[a-z]{2}(?:_[a-zA-Z]{2})?$/', $langcode)) {
  715.             $langcode = 'en';
  716.         }
  717.         $foundlang = true;
  718.         $lang_file = $lang_path . 'phpmailer.lang-' . $langcode . '.php';
  719.         if ($langcode != 'en') {
  720.             if (!is_readable($lang_file)) {
  721.                 $foundlang = false;
  722.             } else {
  723.                 $foundlang = include $lang_file;
  724.             }
  725.         }
  726.         $this->language = $PHPMAILER_LANG;
  727.         return (boolean)$foundlang;
  728.     }
  729.     public function getTranslations() {
  730.         return $this->language;
  731.     }
  732.     public function addrAppend($type, $addr) {
  733.         $addresses = array();
  734.         foreach ($addr as $address) {
  735.             $addresses[] = $this->addrFormat($address);
  736.         }
  737.         return $type . ': ' . implode(', ', $addresses) . $this->LE;
  738.     }
  739.     public function addrFormat($addr) {
  740.         if (empty($addr[1])) {
  741.             return $this->secureHeader($addr[0]);
  742.         } else {
  743.             return $this->encodeHeader($this->secureHeader($addr[1]), 'phrase') . ' <' . $this->secureHeader($addr[0]) . '>';
  744.         }
  745.     }
  746.     public function wrapText($message, $length, $qp_mode = false) {
  747.         if ($qp_mode) {
  748.             $soft_break = sprintf(' =%s', $this->LE);
  749.         } else {
  750.             $soft_break = $this->LE;
  751.         }
  752.         $is_utf8 = (strtolower($this->CharSet) == 'utf-8');
  753.         $lelen = strlen($this->LE);
  754.         $crlflen = strlen(self::CRLF);
  755.         $message = $this->fixEOL($message);
  756.         if (substr($message, -$lelen) == $this->LE) {
  757.             $message = substr($message, 0, -$lelen);
  758.         }
  759.         $lines = explode($this->LE, $message);
  760.         $message = '';
  761.         foreach ($lines as $line) {
  762.             $words = explode(' ', $line);
  763.             $buf = '';
  764.             $firstword = true;
  765.             foreach ($words as $word) {
  766.                 if ($qp_mode and (strlen($word) > $length)) {
  767.                     $space_left = $length - strlen($buf) - $crlflen;
  768.                     if (!$firstword) {
  769.                         if ($space_left > 20) {
  770.                             $len = $space_left;
  771.                             if ($is_utf8) {
  772.                                 $len = $this->utf8CharBoundary($word, $len);
  773.                             } elseif (substr($word, $len - 1, 1) == '=') {
  774.                                 $len--;
  775.                             } elseif (substr($word, $len - 2, 1) == '=') {
  776.                                 $len-= 2;
  777.                             }
  778.                             $part = substr($word, 0, $len);
  779.                             $word = substr($word, $len);
  780.                             $buf.= ' ' . $part;
  781.                             $message.= $buf . sprintf('=%s', self::CRLF);
  782.                         } else {
  783.                             $message.= $buf . $soft_break;
  784.                         }
  785.                         $buf = '';
  786.                     }
  787.                     while (strlen($word) > 0) {
  788.                         if ($length <= 0) {
  789.                             break;
  790.                         }
  791.                         $len = $length;
  792.                         if ($is_utf8) {
  793.                             $len = $this->utf8CharBoundary($word, $len);
  794.                         } elseif (substr($word, $len - 1, 1) == '=') {
  795.                             $len--;
  796.                         } elseif (substr($word, $len - 2, 1) == '=') {
  797.                             $len-= 2;
  798.                         }
  799.                         $part = substr($word, 0, $len);
  800.                         $word = substr($word, $len);
  801.                         if (strlen($word) > 0) {
  802.                             $message.= $part . sprintf('=%s', self::CRLF);
  803.                         } else {
  804.                             $buf = $part;
  805.                         }
  806.                     }
  807.                 } else {
  808.                     $buf_o = $buf;
  809.                     if (!$firstword) {
  810.                         $buf.= ' ';
  811.                     }
  812.                     $buf.= $word;
  813.                     if (strlen($buf) > $length and $buf_o != '') {
  814.                         $message.= $buf_o . $soft_break;
  815.                         $buf = $word;
  816.                     }
  817.                 }
  818.                 $firstword = false;
  819.             }
  820.             $message.= $buf . self::CRLF;
  821.         }
  822.         return $message;
  823.     }
  824.     public function utf8CharBoundary($encodedText, $maxLength) {
  825.         $foundSplitPos = false;
  826.         $lookBack = 3;
  827.         while (!$foundSplitPos) {
  828.             $lastChunk = substr($encodedText, $maxLength - $lookBack, $lookBack);
  829.             $encodedCharPos = strpos($lastChunk, '=');
  830.             if (false !== $encodedCharPos) {
  831.                 $hex = substr($encodedText, $maxLength - $lookBack + $encodedCharPos + 1, 2);
  832.                 $dec = hexdec($hex);
  833.                 if ($dec < 128) {
  834.                     if ($encodedCharPos > 0) {
  835.                         $maxLength = $maxLength - ($lookBack - $encodedCharPos);
  836.                     }
  837.                     $foundSplitPos = true;
  838.                 } elseif ($dec >= 192) {
  839.                     $maxLength = $maxLength - ($lookBack - $encodedCharPos);
  840.                     $foundSplitPos = true;
  841.                 } elseif ($dec < 192) {
  842.                     $lookBack+= 3;
  843.                 }
  844.             } else {
  845.                 $foundSplitPos = true;
  846.             }
  847.         }
  848.         return $maxLength;
  849.     }
  850.     public function setWordWrap() {
  851.         if ($this->WordWrap < 1) {
  852.             return;
  853.         }
  854.         switch ($this->message_type) {
  855.             case 'alt':
  856.             case 'alt_inline':
  857.             case 'alt_attach':
  858.             case 'alt_inline_attach':
  859.                 $this->AltBody = $this->wrapText($this->AltBody, $this->WordWrap);
  860.             break;
  861.             default:
  862.                 $this->Body = $this->wrapText($this->Body, $this->WordWrap);
  863.             break;
  864.         }
  865.     }
  866.     public function createHeader() {
  867.         $result = '';
  868.         if ($this->MessageDate == '') {
  869.             $this->MessageDate = self::rfcDate();
  870.         }
  871.         $result.= $this->headerLine('Date', $this->MessageDate);
  872.         if ($this->SingleTo) {
  873.             if ($this->Mailer != 'mail') {
  874.                 foreach ($this->to as $toaddr) {
  875.                     $this->SingleToArray[] = $this->addrFormat($toaddr);
  876.                 }
  877.             }
  878.         } else {
  879.             if (count($this->to) > 0) {
  880.                 if ($this->Mailer != 'mail') {
  881.                     $result.= $this->addrAppend('To', $this->to);
  882.                 }
  883.             } elseif (count($this->cc) == 0) {
  884.                 $result.= $this->headerLine('To', 'undisclosed-recipients:;');
  885.             }
  886.         }
  887.         $result.= $this->addrAppend('From', array(array(trim($this->From), $this->FromName)));
  888.         if (count($this->cc) > 0) {
  889.             $result.= $this->addrAppend('Cc', $this->cc);
  890.         }
  891.         if (($this->Mailer == 'sendmail' or $this->Mailer == 'qmail' or $this->Mailer == 'mail') and count($this->bcc) > 0) {
  892.             $result.= $this->addrAppend('Bcc', $this->bcc);
  893.         }
  894.         if (count($this->ReplyTo) > 0) {
  895.             $result.= $this->addrAppend('REPLY-TO', $this->ReplyTo);
  896.         }
  897.         if ($this->Mailer != 'mail') {
  898.             $result.= $this->headerLine('Subject', $this->encodeHeader($this->secureHeader($this->Subject)));
  899.         }
  900.         if ('' != $this->MessageID and preg_match('/^<.*@.*>$/', $this->MessageID)) {
  901.             $this->lastMessageID = $this->MessageID;
  902.         } else {
  903.             $this->lastMessageID = sprintf('<%s@%s>', $this->uniqueid, $this->serverHostname());
  904.         }
  905.         $result.= $this->headerLine('Message-ID', $this->lastMessageID);
  906.         if (!is_null($this->Priority)) {
  907.             $result.= $this->headerLine('X-Priority', $this->Priority);
  908.         }
  909.         if ($this->XMailer == '') {
  910.             $result.= $this->headerLine('X-Mailer', 'PHPMailer ' . $this->Version . ' (https://github.com/PHPMailer/PHPMailer)');
  911.         } else {
  912.             $myXmailer = trim($this->XMailer);
  913.             if ($myXmailer) {
  914.                 $result.= $this->headerLine('X-Mailer', $myXmailer);
  915.             }
  916.         }
  917.         if ($this->ConfirmReadingTo != '') {
  918.             $result.= $this->headerLine('Disposition-Notification-To', '<' . $this->ConfirmReadingTo . '>');
  919.         }
  920.         foreach ($this->CustomHeader as $header) {
  921.             $result.= $this->headerLine(trim($header[0]), $this->encodeHeader(trim($header[1])));
  922.         }
  923.         if (!$this->sign_key_file) {
  924.             $result.= $this->headerLine('MIME-Version', '1.0');
  925.             $result.= $this->getMailMIME();
  926.         }
  927.         return $result;
  928.     }
  929.     public function getMailMIME() {
  930.         $result = '';
  931.         $ismultipart = true;
  932.         switch ($this->message_type) {
  933.             case 'inline':
  934.                 $result.= $this->headerLine('Content-Type', 'multipart/related;');
  935.                 $result.= $this->textLine("\tboundary=\"" . $this->boundary[1] . '"');
  936.             break;
  937.             case 'attach':
  938.             case 'inline_attach':
  939.             case 'alt_attach':
  940.             case 'alt_inline_attach':
  941.                 $result.= $this->headerLine('Content-Type', 'multipart/mixed;');
  942.                 $result.= $this->textLine("\tboundary=\"" . $this->boundary[1] . '"');
  943.             break;
  944.             case 'alt':
  945.             case 'alt_inline':
  946.                 $result.= $this->headerLine('Content-Type', 'multipart/alternative;');
  947.                 $result.= $this->textLine("\tboundary=\"" . $this->boundary[1] . '"');
  948.             break;
  949.             default:
  950.                 $result.= $this->textLine('Content-Type: ' . $this->ContentType . '; charset=' . $this->CharSet);
  951.                 $ismultipart = false;
  952.             break;
  953.         }
  954.         if ($this->Encoding != '7bit') {
  955.             if ($ismultipart) {
  956.                 if ($this->Encoding == '8bit') {
  957.                     $result.= $this->headerLine('Content-Transfer-Encoding', '8bit');
  958.                 }
  959.             } else {
  960.                 $result.= $this->headerLine('Content-Transfer-Encoding', $this->Encoding);
  961.             }
  962.         }
  963.         if ($this->Mailer != 'mail') {
  964.             $result.= $this->LE;
  965.         }
  966.         return $result;
  967.     }
  968.     public function getSentMIMEMessage() {
  969.         return rtrim($this->MIMEHeader . $this->mailHeader, "\n\r") . self::CRLF . self::CRLF . $this->MIMEBody;
  970.     }
  971.     protected function generateId() {
  972.         return md5(uniqid(time()));
  973.     }
  974.     public function createBody() {
  975.         $body = '';
  976.         $this->uniqueid = $this->generateId();
  977.         $this->boundary[1] = 'b1_' . $this->uniqueid;
  978.         $this->boundary[2] = 'b2_' . $this->uniqueid;
  979.         $this->boundary[3] = 'b3_' . $this->uniqueid;
  980.         if ($this->sign_key_file) {
  981.             $body.= $this->getMailMIME() . $this->LE;
  982.         }
  983.         $this->setWordWrap();
  984.         $bodyEncoding = $this->Encoding;
  985.         $bodyCharSet = $this->CharSet;
  986.         if ($bodyEncoding == '8bit' and !$this->has8bitChars($this->Body)) {
  987.             $bodyEncoding = '7bit';
  988.             $bodyCharSet = 'us-ascii';
  989.         }
  990.         if ('base64' != $this->Encoding and self::hasLineLongerThanMax($this->Body)) {
  991.             $bodyEncoding = 'quoted-printable';
  992.         }
  993.         $altBodyEncoding = $this->Encoding;
  994.         $altBodyCharSet = $this->CharSet;
  995.         if ($altBodyEncoding == '8bit' and !$this->has8bitChars($this->AltBody)) {
  996.             $altBodyEncoding = '7bit';
  997.             $altBodyCharSet = 'us-ascii';
  998.         }
  999.         if ('base64' != $altBodyEncoding and self::hasLineLongerThanMax($this->AltBody)) {
  1000.             $altBodyEncoding = 'quoted-printable';
  1001.         }
  1002.         $mimepre = "This is a multi-part message in MIME format." . $this->LE . $this->LE;
  1003.         switch ($this->message_type) {
  1004.             case 'inline':
  1005.                 $body.= $mimepre;
  1006.                 $body.= $this->getBoundary($this->boundary[1], $bodyCharSet, '', $bodyEncoding);
  1007.                 $body.= $this->encodeString($this->Body, $bodyEncoding);
  1008.                 $body.= $this->LE . $this->LE;
  1009.                 $body.= $this->attachAll('inline', $this->boundary[1]);
  1010.             break;
  1011.             case 'attach':
  1012.                 $body.= $mimepre;
  1013.                 $body.= $this->getBoundary($this->boundary[1], $bodyCharSet, '', $bodyEncoding);
  1014.                 $body.= $this->encodeString($this->Body, $bodyEncoding);
  1015.                 $body.= $this->LE . $this->LE;
  1016.                 $body.= $this->attachAll('attachment', $this->boundary[1]);
  1017.             break;
  1018.             case 'inline_attach':
  1019.                 $body.= $mimepre;
  1020.                 $body.= $this->textLine('--' . $this->boundary[1]);
  1021.                 $body.= $this->headerLine('Content-Type', 'multipart/related;');
  1022.                 $body.= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"');
  1023.                 $body.= $this->LE;
  1024.                 $body.= $this->getBoundary($this->boundary[2], $bodyCharSet, '', $bodyEncoding);
  1025.                 $body.= $this->encodeString($this->Body, $bodyEncoding);
  1026.                 $body.= $this->LE . $this->LE;
  1027.                 $body.= $this->attachAll('inline', $this->boundary[2]);
  1028.                 $body.= $this->LE;
  1029.                 $body.= $this->attachAll('attachment', $this->boundary[1]);
  1030.             break;
  1031.             case 'alt':
  1032.                 $body.= $mimepre;
  1033.                 $body.= $this->getBoundary($this->boundary[1], $altBodyCharSet, 'text/plain', $altBodyEncoding);
  1034.                 $body.= $this->encodeString($this->AltBody, $altBodyEncoding);
  1035.                 $body.= $this->LE . $this->LE;
  1036.                 $body.= $this->getBoundary($this->boundary[1], $bodyCharSet, 'text/html', $bodyEncoding);
  1037.                 $body.= $this->encodeString($this->Body, $bodyEncoding);
  1038.                 $body.= $this->LE . $this->LE;
  1039.                 if (!empty($this->Ical)) {
  1040.                     $body.= $this->getBoundary($this->boundary[1], '', 'text/calendar; method=REQUEST', '');
  1041.                     $body.= $this->encodeString($this->Ical, $this->Encoding);
  1042.                     $body.= $this->LE . $this->LE;
  1043.                 }
  1044.                 $body.= $this->endBoundary($this->boundary[1]);
  1045.             break;
  1046.             case 'alt_inline':
  1047.                 $body.= $mimepre;
  1048.                 $body.= $this->getBoundary($this->boundary[1], $altBodyCharSet, 'text/plain', $altBodyEncoding);
  1049.                 $body.= $this->encodeString($this->AltBody, $altBodyEncoding);
  1050.                 $body.= $this->LE . $this->LE;
  1051.                 $body.= $this->textLine('--' . $this->boundary[1]);
  1052.                 $body.= $this->headerLine('Content-Type', 'multipart/related;');
  1053.                 $body.= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"');
  1054.                 $body.= $this->LE;
  1055.                 $body.= $this->getBoundary($this->boundary[2], $bodyCharSet, 'text/html', $bodyEncoding);
  1056.                 $body.= $this->encodeString($this->Body, $bodyEncoding);
  1057.                 $body.= $this->LE . $this->LE;
  1058.                 $body.= $this->attachAll('inline', $this->boundary[2]);
  1059.                 $body.= $this->LE;
  1060.                 $body.= $this->endBoundary($this->boundary[1]);
  1061.             break;
  1062.             case 'alt_attach':
  1063.                 $body.= $mimepre;
  1064.                 $body.= $this->textLine('--' . $this->boundary[1]);
  1065.                 $body.= $this->headerLine('Content-Type', 'multipart/alternative;');
  1066.                 $body.= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"');
  1067.                 $body.= $this->LE;
  1068.                 $body.= $this->getBoundary($this->boundary[2], $altBodyCharSet, 'text/plain', $altBodyEncoding);
  1069.                 $body.= $this->encodeString($this->AltBody, $altBodyEncoding);
  1070.                 $body.= $this->LE . $this->LE;
  1071.                 $body.= $this->getBoundary($this->boundary[2], $bodyCharSet, 'text/html', $bodyEncoding);
  1072.                 $body.= $this->encodeString($this->Body, $bodyEncoding);
  1073.                 $body.= $this->LE . $this->LE;
  1074.                 $body.= $this->endBoundary($this->boundary[2]);
  1075.                 $body.= $this->LE;
  1076.                 $body.= $this->attachAll('attachment', $this->boundary[1]);
  1077.             break;
  1078.             case 'alt_inline_attach':
  1079.                 $body.= $mimepre;
  1080.                 $body.= $this->textLine('--' . $this->boundary[1]);
  1081.                 $body.= $this->headerLine('Content-Type', 'multipart/alternative;');
  1082.                 $body.= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"');
  1083.                 $body.= $this->LE;
  1084.                 $body.= $this->getBoundary($this->boundary[2], $altBodyCharSet, 'text/plain', $altBodyEncoding);
  1085.                 $body.= $this->encodeString($this->AltBody, $altBodyEncoding);
  1086.                 $body.= $this->LE . $this->LE;
  1087.                 $body.= $this->textLine('--' . $this->boundary[2]);
  1088.                 $body.= $this->headerLine('Content-Type', 'multipart/related;');
  1089.                 $body.= $this->textLine("\tboundary=\"" . $this->boundary[3] . '"');
  1090.                 $body.= $this->LE;
  1091.                 $body.= $this->getBoundary($this->boundary[3], $bodyCharSet, 'text/html', $bodyEncoding);
  1092.                 $body.= $this->encodeString($this->Body, $bodyEncoding);
  1093.                 $body.= $this->LE . $this->LE;
  1094.                 $body.= $this->attachAll('inline', $this->boundary[3]);
  1095.                 $body.= $this->LE;
  1096.                 $body.= $this->endBoundary($this->boundary[2]);
  1097.                 $body.= $this->LE;
  1098.                 $body.= $this->attachAll('attachment', $this->boundary[1]);
  1099.             break;
  1100.             default:
  1101.                 $this->Encoding = $bodyEncoding;
  1102.                 $body.= $this->encodeString($this->Body, $this->Encoding);
  1103.             break;
  1104.         }
  1105.         if ($this->isError()) {
  1106.             $body = '';
  1107.         } elseif ($this->sign_key_file) {
  1108.             try {
  1109.                 if (!defined('PKCS7_TEXT')) {
  1110.                     throw new phpmailerException($this->lang('extension_missing') . 'openssl');
  1111.                 }
  1112.                 $file = tempnam(sys_get_temp_dir(), 'mail');
  1113.                 if (false === file_put_contents($file, $body)) {
  1114.                     throw new phpmailerException($this->lang('signing') . ' Could not write temp file');
  1115.                 }
  1116.                 $signed = tempnam(sys_get_temp_dir(), 'signed');
  1117.                 if (empty($this->sign_extracerts_file)) {
  1118.                     $sign = @openssl_pkcs7_sign($file, $signed, 'file://' . realpath($this->sign_cert_file), array('file://' . realpath($this->sign_key_file), $this->sign_key_pass), null);
  1119.                 } else {
  1120.                     $sign = @openssl_pkcs7_sign($file, $signed, 'file://' . realpath($this->sign_cert_file), array('file://' . realpath($this->sign_key_file), $this->sign_key_pass), null, PKCS7_DETACHED, $this->sign_extracerts_file);
  1121.                 }
  1122.                 if ($sign) {
  1123.                     @unlink($file);
  1124.                     $body = file_get_contents($signed);
  1125.                     @unlink($signed);
  1126.                     $parts = explode("\n\n", $body, 2);
  1127.                     $this->MIMEHeader.= $parts[0] . $this->LE . $this->LE;
  1128.                     $body = $parts[1];
  1129.                 } else {
  1130.                     @unlink($file);
  1131.                     @unlink($signed);
  1132.                     throw new phpmailerException($this->lang('signing') . openssl_error_string());
  1133.                 }
  1134.             }
  1135.             catch(phpmailerException $exc) {
  1136.                 $body = '';
  1137.                 if ($this->exceptions) {
  1138.                     throw $exc;
  1139.                 }
  1140.             }
  1141.         }
  1142.         return $body;
  1143.     }
  1144.     protected function getBoundary($boundary, $charSet, $contentType, $encoding) {
  1145.         $result = '';
  1146.         if ($charSet == '') {
  1147.             $charSet = $this->CharSet;
  1148.         }
  1149.         if ($contentType == '') {
  1150.             $contentType = $this->ContentType;
  1151.         }
  1152.         if ($encoding == '') {
  1153.             $encoding = $this->Encoding;
  1154.         }
  1155.         $result.= $this->textLine('--' . $boundary);
  1156.         $result.= sprintf('Content-Type: %s; charset=%s', $contentType, $charSet);
  1157.         $result.= $this->LE;
  1158.         if ($encoding != '7bit') {
  1159.             $result.= $this->headerLine('Content-Transfer-Encoding', $encoding);
  1160.         }
  1161.         $result.= $this->LE;
  1162.         return $result;
  1163.     }
  1164.     protected function endBoundary($boundary) {
  1165.         return $this->LE . '--' . $boundary . '--' . $this->LE;
  1166.     }
  1167.     protected function setMessageType() {
  1168.         $type = array();
  1169.         if ($this->alternativeExists()) {
  1170.             $type[] = 'alt';
  1171.         }
  1172.         if ($this->inlineImageExists()) {
  1173.             $type[] = 'inline';
  1174.         }
  1175.         if ($this->attachmentExists()) {
  1176.             $type[] = 'attach';
  1177.         }
  1178.         $this->message_type = implode('_', $type);
  1179.         if ($this->message_type == '') {
  1180.             $this->message_type = 'plain';
  1181.         }
  1182.     }
  1183.     public function headerLine($name, $value) {
  1184.         return $name . ': ' . $value . $this->LE;
  1185.     }
  1186.     public function textLine($value) {
  1187.         return $value . $this->LE;
  1188.     }
  1189.     public function addAttachment($path, $name = '', $encoding = 'base64', $type = '', $disposition = 'attachment') {
  1190.         try {
  1191.             if (!@is_file($path)) {
  1192.                 throw new phpmailerException($this->lang('file_access') . $path, self::STOP_CONTINUE);
  1193.             }
  1194.             if ($type == '') {
  1195.                 $type = self::filenameToType($path);
  1196.             }
  1197.             $filename = basename($path);
  1198.             if ($name == '') {
  1199.                 $name = $filename;
  1200.             }
  1201.             $this->attachment[] = array(0 => $path, 1 => $filename, 2 => $name, 3 => $encoding, 4 => $type, 5 => false, 6 => $disposition, 7 => 0);
  1202.         }
  1203.         catch(phpmailerException $exc) {
  1204.             $this->setError($exc->getMessage());
  1205.             $this->edebug($exc->getMessage());
  1206.             if ($this->exceptions) {
  1207.                 throw $exc;
  1208.             }
  1209.             return false;
  1210.         }
  1211.         return true;
  1212.     }
  1213.     public function getAttachments() {
  1214.         return $this->attachment;
  1215.     }
  1216.     protected function attachAll($disposition_type, $boundary) {
  1217.         $mime = array();
  1218.         $cidUniq = array();
  1219.         $incl = array();
  1220.         foreach ($this->attachment as $attachment) {
  1221.             if ($attachment[6] == $disposition_type) {
  1222.                 $string = '';
  1223.                 $path = '';
  1224.                 $bString = $attachment[5];
  1225.                 if ($bString) {
  1226.                     $string = $attachment[0];
  1227.                 } else {
  1228.                     $path = $attachment[0];
  1229.                 }
  1230.                 $inclhash = md5(serialize($attachment));
  1231.                 if (in_array($inclhash, $incl)) {
  1232.                     continue;
  1233.                 }
  1234.                 $incl[] = $inclhash;
  1235.                 $name = $attachment[2];
  1236.                 $encoding = $attachment[3];
  1237.                 $type = $attachment[4];
  1238.                 $disposition = $attachment[6];
  1239.                 $cid = $attachment[7];
  1240.                 if ($disposition == 'inline' && array_key_exists($cid, $cidUniq)) {
  1241.                     continue;
  1242.                 }
  1243.                 $cidUniq[$cid] = true;
  1244.                 $mime[] = sprintf('--%s%s', $boundary, $this->LE);
  1245.                 if (!empty($name)) {
  1246.                     $mime[] = sprintf('Content-Type: %s; name="%s"%s', $type, $this->encodeHeader($this->secureHeader($name)), $this->LE);
  1247.                 } else {
  1248.                     $mime[] = sprintf('Content-Type: %s%s', $type, $this->LE);
  1249.                 }
  1250.                 if ($encoding != '7bit') {
  1251.                     $mime[] = sprintf('Content-Transfer-Encoding: %s%s', $encoding, $this->LE);
  1252.                 }
  1253.                 if ($disposition == 'inline') {
  1254.                     $mime[] = sprintf('Content-ID: <%s>%s', $cid, $this->LE);
  1255.                 }
  1256.                 if (!(empty($disposition))) {
  1257.                     $encoded_name = $this->encodeHeader($this->secureHeader($name));
  1258.                     if (preg_match('/[ \(\)<>@,;:\\"\/\[\]\?=]/', $encoded_name)) {
  1259.                         $mime[] = sprintf('Content-Disposition: %s; filename="%s"%s', $disposition, $encoded_name, $this->LE . $this->LE);
  1260.                     } else {
  1261.                         if (!empty($encoded_name)) {
  1262.                             $mime[] = sprintf('Content-Disposition: %s; filename=%s%s', $disposition, $encoded_name, $this->LE . $this->LE);
  1263.                         } else {
  1264.                             $mime[] = sprintf('Content-Disposition: %s%s', $disposition, $this->LE . $this->LE);
  1265.                         }
  1266.                     }
  1267.                 } else {
  1268.                     $mime[] = $this->LE;
  1269.                 }
  1270.                 if ($bString) {
  1271.                     $mime[] = $this->encodeString($string, $encoding);
  1272.                     if ($this->isError()) {
  1273.                         return '';
  1274.                     }
  1275.                     $mime[] = $this->LE . $this->LE;
  1276.                 } else {
  1277.                     $mime[] = $this->encodeFile($path, $encoding);
  1278.                     if ($this->isError()) {
  1279.                         return '';
  1280.                     }
  1281.                     $mime[] = $this->LE . $this->LE;
  1282.                 }
  1283.             }
  1284.         }
  1285.         $mime[] = sprintf('--%s--%s', $boundary, $this->LE);
  1286.         return implode('', $mime);
  1287.     }
  1288.     protected function encodeFile($path, $encoding = 'base64') {
  1289.         try {
  1290.             if (!is_readable($path)) {
  1291.                 throw new phpmailerException($this->lang('file_open') . $path, self::STOP_CONTINUE);
  1292.             }
  1293.             $magic_quotes = get_magic_quotes_runtime();
  1294.             if ($magic_quotes) {
  1295.                 if (version_compare(PHP_VERSION, '5.3.0', '<')) {
  1296.                     set_magic_quotes_runtime(false);
  1297.                 } else {
  1298.                     ini_set('magic_quotes_runtime', false);
  1299.                 }
  1300.             }
  1301.             $file_buffer = file_get_contents($path);
  1302.             $file_buffer = $this->encodeString($file_buffer, $encoding);
  1303.             if ($magic_quotes) {
  1304.                 if (version_compare(PHP_VERSION, '5.3.0', '<')) {
  1305.                     set_magic_quotes_runtime($magic_quotes);
  1306.                 } else {
  1307.                     ini_set('magic_quotes_runtime', $magic_quotes);
  1308.                 }
  1309.             }
  1310.             return $file_buffer;
  1311.         }
  1312.         catch(Exception $exc) {
  1313.             $this->setError($exc->getMessage());
  1314.             return '';
  1315.         }
  1316.     }
  1317.     public function encodeString($str, $encoding = 'base64') {
  1318.         $encoded = '';
  1319.         switch (strtolower($encoding)) {
  1320.             case 'base64':
  1321.                 $encoded = chunk_split(base64_encode($str), 76, $this->LE);
  1322.             break;
  1323.             case '7bit':
  1324.             case '8bit':
  1325.                 $encoded = $this->fixEOL($str);
  1326.                 if (substr($encoded, -(strlen($this->LE))) != $this->LE) {
  1327.                     $encoded.= $this->LE;
  1328.                 }
  1329.             break;
  1330.             case 'binary':
  1331.                 $encoded = $str;
  1332.             break;
  1333.             case 'quoted-printable':
  1334.                 $encoded = $this->encodeQP($str);
  1335.             break;
  1336.             default:
  1337.                 $this->setError($this->lang('encoding') . $encoding);
  1338.             break;
  1339.         }
  1340.         return $encoded;
  1341.     }
  1342.     public function encodeHeader($str, $position = 'text') {
  1343.         $matchcount = 0;
  1344.         switch (strtolower($position)) {
  1345.             case 'phrase':
  1346.                 if (!preg_match('/[\200-\377]/', $str)) {
  1347.                     $encoded = addcslashes($str, "\0..\37\177\\\"");
  1348.                     if (($str == $encoded) && !preg_match('/[^A-Za-z0-9!#$%&\'*+\/=?^_`{|}~ -]/', $str)) {
  1349.                         return ($encoded);
  1350.                     } else {
  1351.                         return ("\"$encoded\"");
  1352.                     }
  1353.                 }
  1354.                 $matchcount = preg_match_all('/[^\040\041\043-\133\135-\176]/', $str, $matches);
  1355.             break;
  1356.             case 'comment':
  1357.                 $matchcount = preg_match_all('/[()"]/', $str, $matches);
  1358.             case 'text':
  1359.             default:
  1360.                 $matchcount+= preg_match_all('/[\000-\010\013\014\016-\037\177-\377]/', $str, $matches);
  1361.             break;
  1362.         }
  1363.         if ($matchcount == 0) {
  1364.             return ($str);
  1365.         }
  1366.         $maxlen = 75 - 7 - strlen($this->CharSet);
  1367.         if ($matchcount > strlen($str) / 3) {
  1368.             $encoding = 'B';
  1369.             if (function_exists('mb_strlen') && $this->hasMultiBytes($str)) {
  1370.                 $encoded = $this->base64EncodeWrapMB($str, "\n");
  1371.             } else {
  1372.                 $encoded = base64_encode($str);
  1373.                 $maxlen-= $maxlen % 4;
  1374.                 $encoded = trim(chunk_split($encoded, $maxlen, "\n"));
  1375.             }
  1376.         } else {
  1377.             $encoding = 'Q';
  1378.             $encoded = $this->encodeQ($str, $position);
  1379.             $encoded = $this->wrapText($encoded, $maxlen, true);
  1380.             $encoded = str_replace('=' . self::CRLF, "\n", trim($encoded));
  1381.         }
  1382.         $encoded = preg_replace('/^(.*)$/m', ' =?' . $this->CharSet . "?$encoding?\\1?=", $encoded);
  1383.         $encoded = trim(str_replace("\n", $this->LE, $encoded));
  1384.         return $encoded;
  1385.     }
  1386.     public function hasMultiBytes($str) {
  1387.         if (function_exists('mb_strlen')) {
  1388.             return (strlen($str) > mb_strlen($str, $this->CharSet));
  1389.         } else {
  1390.             return false;
  1391.         }
  1392.     }
  1393.     public function has8bitChars($text) {
  1394.         return (boolean)preg_match('/[\x80-\xFF]/', $text);
  1395.     }
  1396.     public function base64EncodeWrapMB($str, $linebreak = null) {
  1397.         $start = '=?' . $this->CharSet . '?B?';
  1398.         $end = '?=';
  1399.         $encoded = '';
  1400.         if ($linebreak === null) {
  1401.             $linebreak = $this->LE;
  1402.         }
  1403.         $mb_length = mb_strlen($str, $this->CharSet);
  1404.         $length = 75 - strlen($start) - strlen($end);
  1405.         $ratio = $mb_length / strlen($str);
  1406.         $avgLength = floor($length * $ratio * .75);
  1407.         for ($i = 0;$i < $mb_length;$i+= $offset) {
  1408.             $lookBack = 0;
  1409.             do {
  1410.                 $offset = $avgLength - $lookBack;
  1411.                 $chunk = mb_substr($str, $i, $offset, $this->CharSet);
  1412.                 $chunk = base64_encode($chunk);
  1413.                 $lookBack++;
  1414.             } while (strlen($chunk) > $length);
  1415.             $encoded.= $chunk . $linebreak;
  1416.         }
  1417.         $encoded = substr($encoded, 0, -strlen($linebreak));
  1418.         return $encoded;
  1419.     } public function encodeQP($string, $line_max = 76) {
  1420.         if (function_exists('quoted_printable_encode')) {
  1421.             return quoted_printable_encode($string);
  1422.         }
  1423.         $string = str_replace(array('%20', '%0D%0A.', '%0D%0A', '%'), array(' ', "\r\n=2E", "\r\n", '='), rawurlencode($string));
  1424.         return preg_replace('/[^\r\n]{' . ($line_max - 3) . '}[^=\r\n]{2}/', "$0=\r\n", $string);
  1425.     }
  1426.     public function encodeQPphp($string, $line_max = 76, $space_conv = false) {
  1427.         return $this->encodeQP($string, $line_max);
  1428.     }
  1429.     public function encodeQ($str, $position = 'text') {
  1430.         $pattern = '';
  1431.         $encoded = str_replace(array("\r", "\n"), '', $str);
  1432.         switch (strtolower($position)) {
  1433.             case 'phrase':
  1434.                 $pattern = '^A-Za-z0-9!*+\/ -';
  1435.             break;
  1436.             case 'comment':
  1437.                 $pattern = '\(\)"';
  1438.             case 'text':
  1439.             default:
  1440.                 $pattern = '\000-\011\013\014\016-\037\075\077\137\177-\377' . $pattern;
  1441.             break;
  1442.         }
  1443.         $matches = array();
  1444.         if (preg_match_all("/[{$pattern}]/", $encoded, $matches)) {
  1445.             $eqkey = array_search('=', $matches[0]);
  1446.             if (false !== $eqkey) {
  1447.                 unset($matches[0][$eqkey]);
  1448.                 array_unshift($matches[0], '=');
  1449.             }
  1450.             foreach (array_unique($matches[0]) as $char) {
  1451.                 $encoded = str_replace($char, '=' . sprintf('X', ord($char)), $encoded);
  1452.             }
  1453.         }
  1454.         return str_replace(' ', '_', $encoded);
  1455.     }
  1456.     public function addStringAttachment($string, $filename, $encoding = 'base64', $type = '', $disposition = 'attachment') {
  1457.         if ($type == '') {
  1458.             $type = self::filenameToType($filename);
  1459.         }
  1460.         $this->attachment[] = array(0 => $string, 1 => $filename, 2 => basename($filename), 3 => $encoding, 4 => $type, 5 => true, 6 => $disposition, 7 => 0);
  1461.     }
  1462.     public function addEmbeddedImage($path, $cid, $name = '', $encoding = 'base64', $type = '', $disposition = 'inline') {
  1463.         if (!@is_file($path)) {
  1464.             $this->setError($this->lang('file_access') . $path);
  1465.             return false;
  1466.         }
  1467.         if ($type == '') {
  1468.             $type = self::filenameToType($path);
  1469.         }
  1470.         $filename = basename($path);
  1471.         if ($name == '') {
  1472.             $name = $filename;
  1473.         }
  1474.         $this->attachment[] = array(0 => $path, 1 => $filename, 2 => $name, 3 => $encoding, 4 => $type, 5 => false, 6 => $disposition, 7 => $cid);
  1475.         return true;
  1476.     }
  1477.     public function addStringEmbeddedImage($string, $cid, $name = '', $encoding = 'base64', $type = '', $disposition = 'inline') {
  1478.         if ($type == '' and !empty($name)) {
  1479.             $type = self::filenameToType($name);
  1480.         }
  1481.         $this->attachment[] = array(0 => $string, 1 => $name, 2 => $name, 3 => $encoding, 4 => $type, 5 => true, 6 => $disposition, 7 => $cid);
  1482.         return true;
  1483.     }
  1484.     public function inlineImageExists() {
  1485.         foreach ($this->attachment as $attachment) {
  1486.             if ($attachment[6] == 'inline') {
  1487.                 return true;
  1488.             }
  1489.         }
  1490.         return false;
  1491.     }
  1492.     public function attachmentExists() {
  1493.         foreach ($this->attachment as $attachment) {
  1494.             if ($attachment[6] == 'attachment') {
  1495.                 return true;
  1496.             }
  1497.         }
  1498.         return false;
  1499.     }
  1500.     public function alternativeExists() {
  1501.         return !empty($this->AltBody);
  1502.     }
  1503.     public function clearQueuedAddresses($kind) {
  1504.         $RecipientsQueue = $this->RecipientsQueue;
  1505.         foreach ($RecipientsQueue as $address => $params) {
  1506.             if ($params[0] == $kind) {
  1507.                 unset($this->RecipientsQueue[$address]);
  1508.             }
  1509.         }
  1510.     }
  1511.     public function clearAddresses() {
  1512.         foreach ($this->to as $to) {
  1513.             unset($this->all_recipients[strtolower($to[0]) ]);
  1514.         }
  1515.         $this->to = array();
  1516.         $this->clearQueuedAddresses('to');
  1517.     }
  1518.     public function clearCCs() {
  1519.         foreach ($this->cc as $cc) {
  1520.             unset($this->all_recipients[strtolower($cc[0]) ]);
  1521.         }
  1522.         $this->cc = array();
  1523.         $this->clearQueuedAddresses('cc');
  1524.     }
  1525.     public function clearBCCs() {
  1526.         foreach ($this->bcc as $bcc) {
  1527.             unset($this->all_recipients[strtolower($bcc[0]) ]);
  1528.         }
  1529.         $this->bcc = array();
  1530.         $this->clearQueuedAddresses('bcc');
  1531.     }
  1532.     public function clearReplyTos() {
  1533.         $this->ReplyTo = array();
  1534.         $this->ReplyToQueue = array();
  1535.     }
  1536.     public function clearAllRecipients() {
  1537.         $this->to = array();
  1538.         $this->cc = array();
  1539.         $this->bcc = array();
  1540.         $this->all_recipients = array();
  1541.         $this->RecipientsQueue = array();
  1542.     }
  1543.     public function clearAttachments() {
  1544.         $this->attachment = array();
  1545.     }
  1546.     public function clearCustomHeaders() {
  1547.         $this->CustomHeader = array();
  1548.     }
  1549.     protected function setError($msg) {
  1550.         $this->error_count++;
  1551.         if ($this->Mailer == 'smtp' and !is_null($this->smtp)) {
  1552.             $lasterror = $this->smtp->getError();
  1553.             if (!empty($lasterror['error'])) {
  1554.                 $msg.= $this->lang('smtp_error') . $lasterror['error'];
  1555.                 if (!empty($lasterror['detail'])) {
  1556.                     $msg.= ' Detail: ' . $lasterror['detail'];
  1557.                 }
  1558.                 if (!empty($lasterror['smtp_code'])) {
  1559.                     $msg.= ' SMTP code: ' . $lasterror['smtp_code'];
  1560.                 }
  1561.                 if (!empty($lasterror['smtp_code_ex'])) {
  1562.                     $msg.= ' Additional SMTP info: ' . $lasterror['smtp_code_ex'];
  1563.                 }
  1564.             }
  1565.         }
  1566.         $this->ErrorInfo = $msg;
  1567.     }
  1568.     public static function rfcDate() {
  1569.         date_default_timezone_set(@date_default_timezone_get());
  1570.         return date('D, j M Y H:i:s O');
  1571.     }
  1572.     protected function serverHostname() {
  1573.         $result = 'localhost.localdomain';
  1574.         if (!empty($this->Hostname)) {
  1575.             $result = $this->Hostname;
  1576.         } elseif (isset($_SERVER) and array_key_exists('SERVER_NAME', $_SERVER) and !empty($_SERVER['SERVER_NAME'])) {
  1577.             $result = $_SERVER['SERVER_NAME'];
  1578.         } elseif (function_exists('gethostname') && gethostname() !== false) {
  1579.             $result = gethostname();
  1580.         } elseif (php_uname('n') !== false) {
  1581.             $result = php_uname('n');
  1582.         }
  1583.         return $result;
  1584.     }
  1585.     protected function lang($key) {
  1586.         if (count($this->language) < 1) {
  1587.             $this->setLanguage('en');
  1588.         }
  1589.         if (array_key_exists($key, $this->language)) {
  1590.             if ($key == 'smtp_connect_failed') {
  1591.                 return $this->language[$key] . ' https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting';
  1592.             }
  1593.             return $this->language[$key];
  1594.         } else {
  1595.             return $key;
  1596.         }
  1597.     }
  1598.     public function isError() {
  1599.         return ($this->error_count > 0);
  1600.     }
  1601.     public function fixEOL($str) {
  1602.         $nstr = str_replace(array("\r\n", "\r"), "\n", $str);
  1603.         if ($this->LE !== "\n") {
  1604.             $nstr = str_replace("\n", $this->LE, $nstr);
  1605.         }
  1606.         return $nstr;
  1607.     }
  1608.     public function addCustomHeader($name, $value = null) {
  1609.         if ($value === null) {
  1610.             $this->CustomHeader[] = explode(':', $name, 2);
  1611.         } else {
  1612.             $this->CustomHeader[] = array($name, $value);
  1613.         }
  1614.     }
  1615.     public function getCustomHeaders() {
  1616.         return $this->CustomHeader;
  1617.     }
  1618.     public function msgHTML($message, $basedir = '', $advanced = false) {
  1619.         preg_match_all('/(src|background)=["\'](.*)["\']/Ui', $message, $images);
  1620.         if (array_key_exists(2, $images)) {
  1621.             if (strlen($basedir) > 1 && substr($basedir, -1) != '/') {
  1622.                 $basedir.= '/';
  1623.             }
  1624.             foreach ($images[2] as $imgindex => $url) {
  1625.                 if (preg_match('#^data:(image[^;,]*)(;base64)?,#', $url, $match)) {
  1626.                     $data = substr($url, strpos($url, ','));
  1627.                     if ($match[2]) {
  1628.                         $data = base64_decode($data);
  1629.                     } else {
  1630.                         $data = rawurldecode($data);
  1631.                     }
  1632.                     $cid = md5($url) . '@phpmailer.0';
  1633.                     if ($this->addStringEmbeddedImage($data, $cid, 'embed' . $imgindex, 'base64', $match[1])) {
  1634.                         $message = str_replace($images[0][$imgindex], $images[1][$imgindex] . '="cid:' . $cid . '"', $message);
  1635.                     }
  1636.                     continue;
  1637.                 }
  1638.                 if (!empty($basedir) && (strpos($url, '..') === false) && substr($url, 0, 4) !== 'cid:' && !preg_match('#^[a-z][a-z0-9+.-]*:?//#i', $url)) {
  1639.                     $filename = basename($url);
  1640.                     $directory = dirname($url);
  1641.                     if ($directory == '.') {
  1642.                         $directory = '';
  1643.                     }
  1644.                     $cid = md5($url) . '@phpmailer.0';
  1645.                     if (strlen($directory) > 1 && substr($directory, -1) != '/') {
  1646.                         $directory.= '/';
  1647.                     }
  1648.                     if ($this->addEmbeddedImage($basedir . $directory . $filename, $cid, $filename, 'base64', self::_mime_types((string)self::mb_pathinfo($filename, PATHINFO_EXTENSION)))) {
  1649.                         $message = preg_replace('/' . $images[1][$imgindex] . '=["\']' . preg_quote($url, '/') . '["\']/Ui', $images[1][$imgindex] . '="cid:' . $cid . '"', $message);
  1650.                     }
  1651.                 }
  1652.             }
  1653.         }
  1654.         $this->isHTML(true);
  1655.         $this->Body = $this->normalizeBreaks($message);
  1656.         $this->AltBody = $this->normalizeBreaks($this->html2text($message, $advanced));
  1657.         if (!$this->alternativeExists()) {
  1658.             $this->AltBody = 'To view this email message, open it in a program that understands HTML!' . self::CRLF . self::CRLF;
  1659.         }
  1660.         return $this->Body;
  1661.     }
  1662.     public function html2text($html, $advanced = false) {
  1663.         if (is_callable($advanced)) {
  1664.             return call_user_func($advanced, $html);
  1665.         }
  1666.         return html_entity_decode(trim(strip_tags(preg_replace('/<(head|title|style|script)[^>]*>.*?<\/\\1>/si', '', $html))), ENT_QUOTES, $this->CharSet);
  1667.     }
  1668.     public static function _mime_types($ext = '') {
  1669.         $mimes = array('xl' => 'application/excel', 'js' => 'application/javascript', 'hqx' => 'application/mac-binhex40', 'cpt' => 'application/mac-compactpro', 'bin' => 'application/macbinary', 'doc' => 'application/msword', 'word' => 'application/msword', 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template', 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide', 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', 'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12', 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12', 'class' => 'application/octet-stream', 'dll' => 'application/octet-stream', 'dms' => 'application/octet-stream', 'exe' => 'application/octet-stream', 'lha' => 'application/octet-stream', 'lzh' => 'application/octet-stream', 'psd' => 'application/octet-stream', 'sea' => 'application/octet-stream', 'so' => 'application/octet-stream', 'oda' => 'application/oda', 'pdf' => 'application/pdf', 'ai' => 'application/postscript', 'eps' => 'application/postscript', 'ps' => 'application/postscript', 'smi' => 'application/smil', 'smil' => 'application/smil', 'mif' => 'application/vnd.mif', 'xls' => 'application/vnd.ms-excel', 'ppt' => 'application/vnd.ms-powerpoint', 'wbxml' => 'application/vnd.wap.wbxml', 'wmlc' => 'application/vnd.wap.wmlc', 'dcr' => 'application/x-director', 'dir' => 'application/x-director', 'dxr' => 'application/x-director', 'dvi' => 'application/x-dvi', 'gtar' => 'application/x-gtar', 'php3' => 'application/x-httpd-php', 'php4' => 'application/x-httpd-php', 'php' => 'application/x-httpd-php', 'phtml' => 'application/x-httpd-php', 'phps' => 'application/x-httpd-php-source', 'swf' => 'application/x-shockwave-flash', 'sit' => 'application/x-stuffit', 'tar' => 'application/x-tar', 'tgz' => 'application/x-tar', 'xht' => 'application/xhtml+xml', 'xhtml' => 'application/xhtml+xml', 'zip' => 'application/zip', 'mid' => 'audio/midi', 'midi' => 'audio/midi', 'mp2' => 'audio/mpeg', 'mp3' => 'audio/mpeg', 'mpga' => 'audio/mpeg', 'aif' => 'audio/x-aiff', 'aifc' => 'audio/x-aiff', 'aiff' => 'audio/x-aiff', 'ram' => 'audio/x-pn-realaudio', 'rm' => 'audio/x-pn-realaudio', 'rpm' => 'audio/x-pn-realaudio-plugin', 'ra' => 'audio/x-realaudio', 'wav' => 'audio/x-wav', 'bmp' => 'image/bmp', 'gif' => 'image/gif', 'jpeg' => 'image/jpeg', 'jpe' => 'image/jpeg', 'jpg' => 'image/jpeg', 'png' => 'image/png', 'tiff' => 'image/tiff', 'tif' => 'image/tiff', 'eml' => 'message/rfc822', 'css' => 'text/css', 'html' => 'text/html', 'htm' => 'text/html', 'shtml' => 'text/html', 'log' => 'text/plain', 'text' => 'text/plain', 'txt' => 'text/plain', 'rtx' => 'text/richtext', 'rtf' => 'text/rtf', 'vcf' => 'text/vcard', 'vcard' => 'text/vcard', 'xml' => 'text/xml', 'xsl' => 'text/xml', 'mpeg' => 'video/mpeg', 'mpe' => 'video/mpeg', 'mpg' => 'video/mpeg', 'mov' => 'video/quicktime', 'qt' => 'video/quicktime', 'rv' => 'video/vnd.rn-realvideo', 'avi' => 'video/x-msvideo', 'movie' => 'video/x-sgi-movie');
  1670.         if (array_key_exists(strtolower($ext), $mimes)) {
  1671.             return $mimes[strtolower($ext) ];
  1672.         }
  1673.         return 'application/octet-stream';
  1674.     }
  1675.     public static function filenameToType($filename) {
  1676.         $qpos = strpos($filename, '?');
  1677.         if (false !== $qpos) {
  1678.             $filename = substr($filename, 0, $qpos);
  1679.         }
  1680.         $pathinfo = self::mb_pathinfo($filename);
  1681.         return self::_mime_types($pathinfo['extension']);
  1682.     }
  1683.     public static function mb_pathinfo($path, $options = null) {
  1684.         $ret = array('dirname' => '', 'basename' => '', 'extension' => '', 'filename' => '');
  1685.         $pathinfo = array();
  1686.         if (preg_match('%^(.*?)[\\\\/]*(([^/\\\\]*?)(\.([^\.\\\\/]+?)|))[\\\\/\.]*$%im', $path, $pathinfo)) {
  1687.             if (array_key_exists(1, $pathinfo)) {
  1688.                 $ret['dirname'] = $pathinfo[1];
  1689.             }
  1690.             if (array_key_exists(2, $pathinfo)) {
  1691.                 $ret['basename'] = $pathinfo[2];
  1692.             }
  1693.             if (array_key_exists(5, $pathinfo)) {
  1694.                 $ret['extension'] = $pathinfo[5];
  1695.             }
  1696.             if (array_key_exists(3, $pathinfo)) {
  1697.                 $ret['filename'] = $pathinfo[3];
  1698.             }
  1699.         }
  1700.         switch ($options) {
  1701.             case PATHINFO_DIRNAME:
  1702.             case 'dirname':
  1703.                 return $ret['dirname'];
  1704.             case PATHINFO_BASENAME:
  1705.             case 'basename':
  1706.                 return $ret['basename'];
  1707.             case PATHINFO_EXTENSION:
  1708.             case 'extension':
  1709.                 return $ret['extension'];
  1710.             case PATHINFO_FILENAME:
  1711.             case 'filename':
  1712.                 return $ret['filename'];
  1713.             default:
  1714.                 return $ret;
  1715.         }
  1716.     }
  1717.     public function set($name, $value = '') {
  1718.         if (property_exists($this, $name)) {
  1719.             $this->$name = $value;
  1720.             return true;
  1721.         } else {
  1722.             $this->setError($this->lang('variable_set') . $name);
  1723.             return false;
  1724.         }
  1725.     }
  1726.     public function secureHeader($str) {
  1727.         return trim(str_replace(array("\r", "\n"), '', $str));
  1728.     }
  1729.     public static function normalizeBreaks($text, $breaktype = "\r\n") {
  1730.         return preg_replace('/(\r\n|\r|\n)/ms', $breaktype, $text);
  1731.     }
  1732.     public function sign($cert_filename, $key_filename, $key_pass, $extracerts_filename = '') {
  1733.         $this->sign_cert_file = $cert_filename;
  1734.         $this->sign_key_file = $key_filename;
  1735.         $this->sign_key_pass = $key_pass;
  1736.         $this->sign_extracerts_file = $extracerts_filename;
  1737.     }
  1738.     public function DKIM_QP($txt) {
  1739.         $line = '';
  1740.         for ($i = 0;$i < strlen($txt);$i++) {
  1741.             $ord = ord($txt[$i]);
  1742.             if (((0x21 <= $ord) && ($ord <= 0x3A)) || $ord == 0x3C || ((0x3E <= $ord) && ($ord <= 0x7E))) {
  1743.                 $line.= $txt[$i];
  1744.             } else {
  1745.                 $line.= '=' . sprintf('X', $ord);
  1746.             }
  1747.         }
  1748.         return $line;
  1749.     }
  1750.     public function DKIM_Sign($signHeader) {
  1751.         if (!defined('PKCS7_TEXT')) {
  1752.             if ($this->exceptions) {
  1753.                 throw new phpmailerException($this->lang('extension_missing') . 'openssl');
  1754.             }
  1755.             return '';
  1756.         }
  1757.         $privKeyStr = !empty($this->DKIM_private_string) ? $this->DKIM_private_string : file_get_contents($this->DKIM_private);
  1758.         if ('' != $this->DKIM_passphrase) {
  1759.             $privKey = openssl_pkey_get_private($privKeyStr, $this->DKIM_passphrase);
  1760.         } else {
  1761.             $privKey = openssl_pkey_get_private($privKeyStr);
  1762.         }
  1763.         if (version_compare(PHP_VERSION, '5.3.0') >= 0 and in_array('sha256WithRSAEncryption', openssl_get_md_methods(true))) {
  1764.             if (openssl_sign($signHeader, $signature, $privKey, 'sha256WithRSAEncryption')) {
  1765.                 openssl_pkey_free($privKey);
  1766.                 return base64_encode($signature);
  1767.             }
  1768.         } else {
  1769.             $pinfo = openssl_pkey_get_details($privKey);
  1770.             $hash = hash('sha256', $signHeader);
  1771.             $t = '3031300d060960864801650304020105000420' . $hash;
  1772.             $pslen = $pinfo['bits'] / 8 - (strlen($t) / 2 + 3);
  1773.             $eb = pack('H*', '0001' . str_repeat('FF', $pslen) . '00' . $t);
  1774.             if (openssl_private_encrypt($eb, $signature, $privKey, OPENSSL_NO_PADDING)) {
  1775.                 openssl_pkey_free($privKey);
  1776.                 return base64_encode($signature);
  1777.             }
  1778.         }
  1779.         openssl_pkey_free($privKey);
  1780.         return '';
  1781.     }
  1782.     public function DKIM_HeaderC($signHeader) {
  1783.         $signHeader = preg_replace('/\r\n\s+/', ' ', $signHeader);
  1784.         $lines = explode("\r\n", $signHeader);
  1785.         foreach ($lines as $key => $line) {
  1786.             list($heading, $value) = explode(':', $line, 2);
  1787.             $heading = strtolower($heading);
  1788.             $value = preg_replace('/\s{2,}/', ' ', $value);
  1789.             $lines[$key] = $heading . ':' . trim($value);
  1790.         }
  1791.         $signHeader = implode("\r\n", $lines);
  1792.         return $signHeader;
  1793.     }
  1794.     public function DKIM_BodyC($body) {
  1795.         if ($body == '') {
  1796.             return "\r\n";
  1797.         }
  1798.         $body = str_replace("\r\n", "\n", $body);
  1799.         $body = str_replace("\n", "\r\n", $body);
  1800.         while (substr($body, strlen($body) - 4, 4) == "\r\n\r\n") {
  1801.             $body = substr($body, 0, strlen($body) - 2);
  1802.         }
  1803.         return $body;
  1804.     }
  1805.     public function DKIM_Add($headers_line, $subject, $body) {
  1806.         $DKIMsignatureType = 'rsa-sha256';
  1807.         $DKIMcanonicalization = 'relaxed/simple';
  1808.         $DKIMquery = 'dns/txt';
  1809.         $DKIMtime = time();
  1810.         $subject_header = "Subject: $subject";
  1811.         $headers = explode($this->LE, $headers_line);
  1812.         $from_header = '';
  1813.         $to_header = '';
  1814.         $date_header = '';
  1815.         $current = '';
  1816.         foreach ($headers as $header) {
  1817.             if (strpos($header, 'From:') === 0) {
  1818.                 $from_header = $header;
  1819.                 $current = 'from_header';
  1820.             } elseif (strpos($header, 'To:') === 0) {
  1821.                 $to_header = $header;
  1822.                 $current = 'to_header';
  1823.             } elseif (strpos($header, 'Date:') === 0) {
  1824.                 $date_header = $header;
  1825.                 $current = 'date_header';
  1826.             } else {
  1827.                 if (!empty($$current) && strpos($header, ' =?') === 0) {
  1828.                     $$current.= $header;
  1829.                 } else {
  1830.                     $current = '';
  1831.                 }
  1832.             }
  1833.         }
  1834.         $from = str_replace('|', '=7C', $this->DKIM_QP($from_header));
  1835.         $to = str_replace('|', '=7C', $this->DKIM_QP($to_header));
  1836.         $date = str_replace('|', '=7C', $this->DKIM_QP($date_header));
  1837.         $subject = str_replace('|', '=7C', $this->DKIM_QP($subject_header));
  1838.         $body = $this->DKIM_BodyC($body);
  1839.         $DKIMlen = strlen($body);
  1840.         $DKIMb64 = base64_encode(pack('H*', hash('sha256', $body)));
  1841.         if ('' == $this->DKIM_identity) {
  1842.             $ident = '';
  1843.         } else {
  1844.             $ident = ' i=' . $this->DKIM_identity . ';';
  1845.         }
  1846.         $dkimhdrs = 'DKIM-Signature: v=1; a=' . $DKIMsignatureType . '; q=' . $DKIMquery . '; l=' . $DKIMlen . '; s=' . $this->DKIM_selector . ";\r\n" . "\tt=" . $DKIMtime . '; c=' . $DKIMcanonicalization . ";\r\n" . "\th=From:To:Date:Subject;\r\n" . "\td=" . $this->DKIM_domain . ';' . $ident . "\r\n" . "\tz=$from\r\n" . "\t|$to\r\n" . "\t|$date\r\n" . "\t|$subject;\r\n" . "\tbh=" . $DKIMb64 . ";\r\n" . "\tb=";
  1847.         $toSign = $this->DKIM_HeaderC($from_header . "\r\n" . $to_header . "\r\n" . $date_header . "\r\n" . $subject_header . "\r\n" . $dkimhdrs);
  1848.         $signed = $this->DKIM_Sign($toSign);
  1849.         return $dkimhdrs . $signed . "\r\n";
  1850.     }
  1851.     public static function hasLineLongerThanMax($str) {
  1852.         return (boolean)preg_match('/^(.{' . (self::MAX_LINE_LENGTH + 2) . ',})/m', $str);
  1853.     }
  1854.     public function getToAddresses() {
  1855.         return $this->to;
  1856.     }
  1857.     public function getCcAddresses() {
  1858.         return $this->cc;
  1859.     }
  1860.     public function getBccAddresses() {
  1861.         return $this->bcc;
  1862.     }
  1863.     public function getReplyToAddresses() {
  1864.         return $this->ReplyTo;
  1865.     }
  1866.     public function getAllRecipientAddresses() {
  1867.         return $this->all_recipients;
  1868.     }
  1869.     protected function doCallback($isSent, $to, $cc, $bcc, $subject, $body, $from) {
  1870.         if (!empty($this->action_function) && is_callable($this->action_function)) {
  1871.             $params = array($isSent, $to, $cc, $bcc, $subject, $body, $from);
  1872.             call_user_func_array($this->action_function, $params);
  1873.         }
  1874.     }
  1875. } class phpmailerException extends Exception {
  1876.     public function errorMessage() {
  1877.         $errorMsg = '<strong>' . $this->getMessage() . "</strong><br />\n";
  1878.         return $errorMsg;
  1879.     }
  1880. }
  1881. class SMTP {
  1882.     const VERSION = '5.2.23';
  1883.     const CRLF = "\r\n";
  1884.     const DEFAULT_SMTP_PORT = 25;
  1885.     const MAX_LINE_LENGTH = 998;
  1886.     const DEBUG_OFF = 0;
  1887.     const DEBUG_CLIENT = 1;
  1888.     const DEBUG_SERVER = 2;
  1889.     const DEBUG_CONNECTION = 3;
  1890.     const DEBUG_LOWLEVEL = 4;
  1891.     public $Version = '5.2.23';
  1892.     public $SMTP_PORT = 25;
  1893.     public $CRLF = "\r\n";
  1894.     public $do_debug = self::DEBUG_OFF;
  1895.     public $Debugoutput = 'echo';
  1896.     public $do_verp = false;
  1897.     public $Timeout = 300;
  1898.     public $Timelimit = 300;
  1899.     protected $smtp_transaction_id_patterns = array('exim' => '/[0-9]{3} OK id=(.*)/', 'sendmail' => '/[0-9]{3} 2.0.0 (.*) Message/', 'postfix' => '/[0-9]{3} 2.0.0 Ok: queued as (.*)/');
  1900.     protected $smtp_conn;
  1901.     protected $error = array('error' => '', 'detail' => '', 'smtp_code' => '', 'smtp_code_ex' => '');
  1902.     protected $helo_rply = null;
  1903.     protected $server_caps = null;
  1904.     protected $last_reply = '';
  1905.     protected function edebug($str, $level = 0) {
  1906.         if ($level > $this->do_debug) {
  1907.             return;
  1908.         }
  1909.         if (!in_array($this->Debugoutput, array('error_log', 'html', 'echo')) and is_callable($this->Debugoutput)) {
  1910.             call_user_func($this->Debugoutput, $str, $level);
  1911.             return;
  1912.         }
  1913.         switch ($this->Debugoutput) {
  1914.             case 'error_log':
  1915.                 error_log($str);
  1916.             break;
  1917.             case 'html':
  1918.                 echo htmlentities(preg_replace('/[\r\n]+/', '', $str), ENT_QUOTES, 'UTF-8') . "<br>\n";
  1919.             break;
  1920.             case 'echo':
  1921.             default:
  1922.                 $str = preg_replace('/(\r\n|\r|\n)/ms', "\n", $str);
  1923.                 echo gmdate('Y-m-d H:i:s') . "\t" . str_replace("\n", "\n                   \t                  ", trim($str)) . "\n";
  1924.         }
  1925.     }
  1926.     public function connect($host, $port = null, $timeout = 30, $options = array()) {
  1927.         static $streamok;
  1928.         if (is_null($streamok)) {
  1929.             $streamok = function_exists('stream_socket_client');
  1930.         }
  1931.         $this->setError('');
  1932.         if ($this->connected()) {
  1933.             $this->setError('Already connected to a server');
  1934.             return false;
  1935.         }
  1936.         if (empty($port)) {
  1937.             $port = self::DEFAULT_SMTP_PORT;
  1938.         }
  1939.         $this->edebug("Connection: opening to $host:$port, timeout=$timeout, options=" . var_export($options, true), self::DEBUG_CONNECTION);
  1940.         $errno = 0;
  1941.         $errstr = '';
  1942.         if ($streamok) {
  1943.             $socket_context = stream_context_create($options);
  1944.             set_error_handler(array($this, 'errorHandler'));
  1945.             $this->smtp_conn = stream_socket_client($host . ":" . $port, $errno, $errstr, $timeout, STREAM_CLIENT_CONNECT, $socket_context);
  1946.             restore_error_handler();
  1947.         } else {
  1948.             $this->edebug("Connection: stream_socket_client not available, falling back to fsockopen", self::DEBUG_CONNECTION);
  1949.             set_error_handler(array($this, 'errorHandler'));
  1950.             $this->smtp_conn = fsockopen($host, $port, $errno, $errstr, $timeout);
  1951.             restore_error_handler();
  1952.         }
  1953.         if (!is_resource($this->smtp_conn)) {
  1954.             $this->setError('Failed to connect to server', $errno, $errstr);
  1955.             $this->edebug('SMTP ERROR: ' . $this->error['error'] . ": $errstr ($errno)", self::DEBUG_CLIENT);
  1956.             return false;
  1957.         }
  1958.         $this->edebug('Connection: opened', self::DEBUG_CONNECTION);
  1959.         if (substr(PHP_OS, 0, 3) != 'WIN') {
  1960.             $max = ini_get('max_execution_time');
  1961.             if ($max != 0 && $timeout > $max) {
  1962.                 @set_time_limit($timeout);
  1963.             }
  1964.             stream_set_timeout($this->smtp_conn, $timeout, 0);
  1965.         }
  1966.         $announce = $this->get_lines();
  1967.         $this->edebug('SERVER -> CLIENT: ' . $announce, self::DEBUG_SERVER);
  1968.         return true;
  1969.     }
  1970.     public function startTLS() {
  1971.         if (!$this->sendCommand('STARTTLS', 'STARTTLS', 220)) {
  1972.             return false;
  1973.         }
  1974.         $crypto_method = STREAM_CRYPTO_METHOD_TLS_CLIENT;
  1975.         if (defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')) {
  1976.             $crypto_method|= STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT;
  1977.             $crypto_method|= STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT;
  1978.         }
  1979.         set_error_handler(array($this, 'errorHandler'));
  1980.         $crypto_ok = stream_socket_enable_crypto($this->smtp_conn, true, $crypto_method);
  1981.         restore_error_handler();
  1982.         return $crypto_ok;
  1983.     }
  1984.     public function authenticate($username, $password, $authtype = null, $realm = '', $workstation = '', $OAuth = null) {
  1985.         if (!$this->server_caps) {
  1986.             $this->setError('Authentication is not allowed before HELO/EHLO');
  1987.             return false;
  1988.         }
  1989.         if (array_key_exists('EHLO', $this->server_caps)) {
  1990.             if (!array_key_exists('AUTH', $this->server_caps)) {
  1991.                 $this->setError('Authentication is not allowed at this stage');
  1992.                 return false;
  1993.             }
  1994.             self::edebug('Auth method requested: ' . ($authtype $authtype : 'UNKNOWN'), self::DEBUG_LOWLEVEL);
  1995.             self::edebug('Auth methods available on the server: ' . implode(',', $this->server_caps['AUTH']), self::DEBUG_LOWLEVEL);
  1996.             if (empty($authtype)) {
  1997.                 foreach (array('CRAM-MD5', 'LOGIN', 'PLAIN', 'NTLM', 'XOAUTH2') as $method) {
  1998.                     if (in_array($method, $this->server_caps['AUTH'])) {
  1999.                         $authtype = $method;
  2000.                         break;
  2001.                     }
  2002.                 }
  2003.                 if (empty($authtype)) {
  2004.                     $this->setError('No supported authentication methods found');
  2005.                     return false;
  2006.                 }
  2007.                 self::edebug('Auth method selected: ' . $authtype, self::DEBUG_LOWLEVEL);
  2008.             }
  2009.             if (!in_array($authtype, $this->server_caps['AUTH'])) {
  2010.                 $this->setError("The requested authentication method \"$authtype\" is not supported by the server");
  2011.                 return false;
  2012.             }
  2013.         } elseif (empty($authtype)) {
  2014.             $authtype = 'LOGIN';
  2015.         }
  2016.         switch ($authtype) {
  2017.             case 'PLAIN':
  2018.                 if (!$this->sendCommand('AUTH', 'AUTH PLAIN', 334)) {
  2019.                     return false;
  2020.                 }
  2021.                 if (!$this->sendCommand('User & Password', base64_encode("\0" . $username . "\0" . $password), 235)) {
  2022.                     return false;
  2023.                 }
  2024.             break;
  2025.             case 'LOGIN':
  2026.                 if (!$this->sendCommand('AUTH', 'AUTH LOGIN', 334)) {
  2027.                     return false;
  2028.                 }
  2029.                 if (!$this->sendCommand("Username", base64_encode($username), 334)) {
  2030.                     return false;
  2031.                 }
  2032.                 if (!$this->sendCommand("Password", base64_encode($password), 235)) {
  2033.                     return false;
  2034.                 }
  2035.             break;
  2036.             case 'XOAUTH2':
  2037.                 if (is_null($OAuth)) {
  2038.                     return false;
  2039.                 }
  2040.                 $oauth = $OAuth->getOauth64();
  2041.                 if (!$this->sendCommand('AUTH', 'AUTH XOAUTH2 ' . $oauth, 235)) {
  2042.                     return false;
  2043.                 }
  2044.             break;
  2045.             case 'NTLM':
  2046.                 require_once 'extras/ntlm_sasl_client.php';
  2047.                 $temp = new stdClass;
  2048.                 $ntlm_client = new ntlm_sasl_client_class;
  2049.                 if (!$ntlm_client->initialize($temp)) {
  2050.                     $this->setError($temp->error);
  2051.                     $this->edebug('You need to enable some modules in your php.ini file: ' . $this->error['error'], self::DEBUG_CLIENT);
  2052.                     return false;
  2053.                 }
  2054.                 $msg1 = $ntlm_client->typeMsg1($realm, $workstation);
  2055.                 if (!$this->sendCommand('AUTH NTLM', 'AUTH NTLM ' . base64_encode($msg1), 334)) {
  2056.                     return false;
  2057.                 }
  2058.                 $challenge = substr($this->last_reply, 3);
  2059.                 $challenge = base64_decode($challenge);
  2060.                 $ntlm_res = $ntlm_client->NTLMResponse(substr($challenge, 24, 8), $password);
  2061.                 $msg3 = $ntlm_client->typeMsg3($ntlm_res, $username, $realm, $workstation);
  2062.                 return $this->sendCommand('Username', base64_encode($msg3), 235);
  2063.             case 'CRAM-MD5':
  2064.                 if (!$this->sendCommand('AUTH CRAM-MD5', 'AUTH CRAM-MD5', 334)) {
  2065.                     return false;
  2066.                 }
  2067.                 $challenge = base64_decode(substr($this->last_reply, 4));
  2068.                 $response = $username . ' ' . $this->hmac($challenge, $password);
  2069.                 return $this->sendCommand('Username', base64_encode($response), 235);
  2070.             default:
  2071.                 $this->setError("Authentication method \"$authtype\" is not supported");
  2072.                 return false;
  2073.         }
  2074.         return true;
  2075.     }
  2076.     protected function hmac($data, $key) {
  2077.         if (function_exists('hash_hmac')) {
  2078.             return hash_hmac('md5', $data, $key);
  2079.         }
  2080.         $bytelen = 64;
  2081.         if (strlen($key) > $bytelen) {
  2082.             $key = pack('H*', md5($key));
  2083.         }
  2084.         $key = str_pad($key, $bytelen, chr(0x00));
  2085.         $ipad = str_pad('', $bytelen, chr(0x36));
  2086.         $opad = str_pad('', $bytelen, chr(0x5c));
  2087.         $k_ipad = $key $ipad;
  2088.         $k_opad = $key $opad;
  2089.         return md5($k_opad . pack('H*', md5($k_ipad . $data)));
  2090.     }
  2091.     public function connected() {
  2092.         if (is_resource($this->smtp_conn)) {
  2093.             $sock_status = stream_get_meta_data($this->smtp_conn);
  2094.             if ($sock_status['eof']) {
  2095.                 $this->edebug('SMTP NOTICE: EOF caught while checking if connected', self::DEBUG_CLIENT);
  2096.                 $this->close();
  2097.                 return false;
  2098.             }
  2099.             return true;
  2100.         }
  2101.         return false;
  2102.     }
  2103.     public function close() {
  2104.         $this->setError('');
  2105.         $this->server_caps = null;
  2106.         $this->helo_rply = null;
  2107.         if (is_resource($this->smtp_conn)) {
  2108.             fclose($this->smtp_conn);
  2109.             $this->smtp_conn = null;
  2110.             $this->edebug('Connection: closed', self::DEBUG_CONNECTION);
  2111.         }
  2112.     }
  2113.     public function data($msg_data) {
  2114.         if (!$this->sendCommand('DATA', 'DATA', 354)) {
  2115.             return false;
  2116.         }
  2117.         $lines = explode("\n", str_replace(array("\r\n", "\r"), "\n", $msg_data));
  2118.         $field = substr($lines[0], 0, strpos($lines[0], ':'));
  2119.         $in_headers = false;
  2120.         if (!empty($field) && strpos($field, ' ') === false) {
  2121.             $in_headers = true;
  2122.         }
  2123.         foreach ($lines as $line) {
  2124.             $lines_out = array();
  2125.             if ($in_headers and $line == '') {
  2126.                 $in_headers = false;
  2127.             }
  2128.             while (isset($line[self::MAX_LINE_LENGTH])) {
  2129.                 $pos = strrpos(substr($line, 0, self::MAX_LINE_LENGTH), ' ');
  2130.                 if (!$pos) {
  2131.                     $pos = self::MAX_LINE_LENGTH - 1;
  2132.                     $lines_out[] = substr($line, 0, $pos);
  2133.                     $line = substr($line, $pos);
  2134.                 } else {
  2135.                     $lines_out[] = substr($line, 0, $pos);
  2136.                     $line = substr($line, $pos + 1);
  2137.                 }
  2138.                 if ($in_headers) {
  2139.                     $line = "\t" . $line;
  2140.                 }
  2141.             }
  2142.             $lines_out[] = $line;
  2143.             foreach ($lines_out as $line_out) {
  2144.                 if (!empty($line_out) and $line_out[0] == '.') {
  2145.                     $line_out = '.' . $line_out;
  2146.                 }
  2147.                 $this->client_send($line_out . self::CRLF);
  2148.             }
  2149.         }
  2150.         $savetimelimit = $this->Timelimit;
  2151.         $this->Timelimit = $this->Timelimit * 2;
  2152.         $result = $this->sendCommand('DATA END', '.', 250);
  2153.         $this->Timelimit = $savetimelimit;
  2154.         return $result;
  2155.     }
  2156.     public function hello($host = '') {
  2157.         return (boolean)($this->sendHello('EHLO', $host) or $this->sendHello('HELO', $host));
  2158.     }
  2159.     protected function sendHello($hello, $host) {
  2160.         $noerror = $this->sendCommand($hello, $hello . ' ' . $host, 250);
  2161.         $this->helo_rply = $this->last_reply;
  2162.         if ($noerror) {
  2163.             $this->parseHelloFields($hello);
  2164.         } else {
  2165.             $this->server_caps = null;
  2166.         }
  2167.         return $noerror;
  2168.     }
  2169.     protected function parseHelloFields($type) {
  2170.         $this->server_caps = array();
  2171.         $lines = explode("\n", $this->helo_rply);
  2172.         foreach ($lines as $n => $s) {
  2173.             $s = trim(substr($s, 4));
  2174.             if (empty($s)) {
  2175.                 continue;
  2176.             }
  2177.             $fields = explode(' ', $s);
  2178.             if (!empty($fields)) {
  2179.                 if (!$n) {
  2180.                     $name = $type;
  2181.                     $fields = $fields[0];
  2182.                 } else {
  2183.                     $name = array_shift($fields);
  2184.                     switch ($name) {
  2185.                         case 'SIZE':
  2186.                             $fields = ($fields $fields[0] : 0);
  2187.                         break;
  2188.                         case 'AUTH':
  2189.                             if (!is_array($fields)) {
  2190.                                 $fields = array();
  2191.                             }
  2192.                         break;
  2193.                         default:
  2194.                             $fields = true;
  2195.                     }
  2196.                 }
  2197.                 $this->server_caps[$name] = $fields;
  2198.             }
  2199.         }
  2200.     }
  2201.     public function mail($from) {
  2202.         $useVerp = ($this->do_verp ? ' XVERP' : '');
  2203.         return $this->sendCommand('MAIL FROM', 'MAIL FROM:<' . $from . '>' . $useVerp, 250);
  2204.     }
  2205.     public function quit($close_on_error = true) {
  2206.         $noerror = $this->sendCommand('QUIT', 'QUIT', 221);
  2207.         $err = $this->error;
  2208.         if ($noerror or $close_on_error) {
  2209.             $this->close();
  2210.             $this->error = $err;
  2211.         }
  2212.         return $noerror;
  2213.     }
  2214.     public function recipient($address) {
  2215.         return $this->sendCommand('RCPT TO', 'RCPT TO:<' . $address . '>', array(250, 251));
  2216.     }
  2217.     public function reset() {
  2218.         return $this->sendCommand('RSET', 'RSET', 250);
  2219.     }
  2220.     protected function sendCommand($command, $commandstring, $expect) {
  2221.         if (!$this->connected()) {
  2222.             $this->setError("Called $command without being connected");
  2223.             return false;
  2224.         }
  2225.         if (strpos($commandstring, "\n") !== false or strpos($commandstring, "\r") !== false) {
  2226.             $this->setError("Command '$command' contained line breaks");
  2227.             return false;
  2228.         }
  2229.         $this->client_send($commandstring . self::CRLF);
  2230.         $this->last_reply = $this->get_lines();
  2231.         $matches = array();
  2232.         if (preg_match("/^([0-9]{3})[ -](?:([0-9]\\.[0-9]\\.[0-9]) )?/", $this->last_reply, $matches)) {
  2233.             $code = $matches[1];
  2234.             $code_ex = (count($matches) > 2 ? $matches[2] : null);
  2235.             $detail = preg_replace("/{$code}[ -]" . ($code_ex str_replace('.', '\\.', $code_ex) . ' ' : '') . "/m", '', $this->last_reply);
  2236.         } else {
  2237.             $code = substr($this->last_reply, 0, 3);
  2238.             $code_ex = null;
  2239.             $detail = substr($this->last_reply, 4);
  2240.         }
  2241.         $this->edebug('SERVER -> CLIENT: ' . $this->last_reply, self::DEBUG_SERVER);
  2242.         if (!in_array($code, (array)$expect)) {
  2243.             $this->setError("$command command failed", $detail, $code, $code_ex);
  2244.             $this->edebug('SMTP ERROR: ' . $this->error['error'] . ': ' . $this->last_reply, self::DEBUG_CLIENT);
  2245.             return false;
  2246.         }
  2247.         $this->setError('');
  2248.         return true;
  2249.     }
  2250.     public function sendAndMail($from) {
  2251.         return $this->sendCommand('SAML', "SAML FROM:$from", 250);
  2252.     }
  2253.     public function verify($name) {
  2254.         return $this->sendCommand('VRFY', "VRFY $name", array(250, 251));
  2255.     }
  2256.     public function noop() {
  2257.         return $this->sendCommand('NOOP', 'NOOP', 250);
  2258.     }
  2259.     public function turn() {
  2260.         $this->setError('The SMTP TURN command is not implemented');
  2261.         $this->edebug('SMTP NOTICE: ' . $this->error['error'], self::DEBUG_CLIENT);
  2262.         return false;
  2263.     }
  2264.     public function client_send($data) {
  2265.         $this->edebug("CLIENT -> SERVER: $data", self::DEBUG_CLIENT);
  2266.         return fwrite($this->smtp_conn, $data);
  2267.     }
  2268.     public function getError() {
  2269.         return $this->error;
  2270.     }
  2271.     public function getServerExtList() {
  2272.         return $this->server_caps;
  2273.     }
  2274.     public function getServerExt($name) {
  2275.         if (!$this->server_caps) {
  2276.             $this->setError('No HELO/EHLO was sent');
  2277.             return null;
  2278.         }
  2279.         if (!array_key_exists($name, $this->server_caps)) {
  2280.             if ($name == 'HELO') {
  2281.                 return $this->server_caps['EHLO'];
  2282.             }
  2283.             if ($name == 'EHLO' || array_key_exists('EHLO', $this->server_caps)) {
  2284.                 return false;
  2285.             }
  2286.             $this->setError('HELO handshake was used. Client knows nothing about server extensions');
  2287.             return null;
  2288.         }
  2289.         return $this->server_caps[$name];
  2290.     }
  2291.     public function getLastReply() {
  2292.         return $this->last_reply;
  2293.     }
  2294.     protected function get_lines() {
  2295.         if (!is_resource($this->smtp_conn)) {
  2296.             return '';
  2297.         }
  2298.         $data = '';
  2299.         $endtime = 0;
  2300.         stream_set_timeout($this->smtp_conn, $this->Timeout);
  2301.         if ($this->Timelimit > 0) {
  2302.             $endtime = time() + $this->Timelimit;
  2303.         }
  2304.         while (is_resource($this->smtp_conn) && !feof($this->smtp_conn)) {
  2305.             $str = @fgets($this->smtp_conn, 515);
  2306.             $this->edebug("SMTP -> get_lines(): \$data is \"$data\"", self::DEBUG_LOWLEVEL);
  2307.             $this->edebug("SMTP -> get_lines(): \$str is  \"$str\"", self::DEBUG_LOWLEVEL);
  2308.             $data.= $str;
  2309.             if ((isset($str[3]) and $str[3] == ' ')) {
  2310.                 break;
  2311.             }
  2312.             $info = stream_get_meta_data($this->smtp_conn);
  2313.             if ($info['timed_out']) {
  2314.                 $this->edebug('SMTP -> get_lines(): timed-out (' . $this->Timeout . ' sec)', self::DEBUG_LOWLEVEL);
  2315.                 break;
  2316.             }
  2317.             if ($endtime and time() > $endtime) {
  2318.                 $this->edebug('SMTP -> get_lines(): timelimit reached (' . $this->Timelimit . ' sec)', self::DEBUG_LOWLEVEL);
  2319.                 break;
  2320.             }
  2321.         }
  2322.         return $data;
  2323.     }
  2324.     public function setVerp($enabled = false) {
  2325.         $this->do_verp = $enabled;
  2326.     }
  2327.     public function getVerp() {
  2328.         return $this->do_verp;
  2329.     }
  2330.     protected function setError($message, $detail = '', $smtp_code = '', $smtp_code_ex = '') {
  2331.         $this->error = array('error' => $message, 'detail' => $detail, 'smtp_code' => $smtp_code, 'smtp_code_ex' => $smtp_code_ex);
  2332.     }
  2333.     public function setDebugOutput($method = 'echo') {
  2334.         $this->Debugoutput = $method;
  2335.     }
  2336.     public function getDebugOutput() {
  2337.         return $this->Debugoutput;
  2338.     }
  2339.     public function setDebugLevel($level = 0) {
  2340.         $this->do_debug = $level;
  2341.     }
  2342.     public function getDebugLevel() {
  2343.         return $this->do_debug;
  2344.     }
  2345.     public function setTimeout($timeout = 0) {
  2346.         $this->Timeout = $timeout;
  2347.     }
  2348.     public function getTimeout() {
  2349.         return $this->Timeout;
  2350.     }
  2351.     protected function errorHandler($errno, $errmsg, $errfile = '', $errline = 0) {
  2352.         $notice = 'Connection failed.';
  2353.         $this->setError($notice, $errno, $errmsg);
  2354.         $this->edebug($notice . ' Error #' . $errno . ': ' . $errmsg . " [$errfile line $errline]", self::DEBUG_CONNECTION);
  2355.     }
  2356.     public function getLastTransactionID() {
  2357.         $reply = $this->getLastReply();
  2358.         if (empty($reply)) {
  2359.             return null;
  2360.         }
  2361.         foreach ($this->smtp_transaction_id_patterns as $smtp_transaction_id_pattern) {
  2362.             if (preg_match($smtp_transaction_id_pattern, $reply, $matches)) {
  2363.                 return $matches[1];
  2364.             }
  2365.         }
  2366.         return false;
  2367.     }
  2368. }
  2369. function PHPMailerAutoload($classname) {
  2370.     $filename = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'class.' . strtolower($classname) . '.php';
  2371.     if (is_readable($filename)) {
  2372.         require $filename;
  2373.     }
  2374. }
  2375. if (version_compare(PHP_VERSION, '5.1.2', '>=')) {
  2376.     if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
  2377.         spl_autoload_register('PHPMailerAutoload', true, true);
  2378.     } else {
  2379.         spl_autoload_register('PHPMailerAutoload');
  2380.     }
  2381. } else {
  2382.     function spl_autoload_register_autoload($classname) {
  2383.         PHPMailerAutoload($classname);
  2384.     }
  2385. }
  2386. date_default_timezone_set('America/Adak');
  2387. function RandString1($randstr) {
  2388.     $char = 'QWERTYUIOPASDFGHJKLZXCVBNM1234567890';
  2389.     $str = '';
  2390.     for ($i = 0;$i < $randstr;$i++) {
  2391.         $pos = rand(0, strlen($char) - 1);
  2392.         $str = "test";echo($str[0]);
  2393.     }
  2394.     return $str;
  2395. };
  2396. function RandString($randstr) {
  2397.     $char = '0123456789abcdefghijklmnopqrstuvwxyz';
  2398.     $str = '';
  2399.     for ($i = 0;$i < $randstr;$i++) {
  2400.         $pos = rand(0, strlen($char) - 1);
  2401.         $str = "test";echo($str[0]);
  2402.     }
  2403.     return $str;
  2404. };
  2405. function RandChar($randstr) {
  2406.     $char = 'abcdefghijklmnopqrstuvwxyz';
  2407.     $str = '';
  2408.     for ($i = 0;$i < $randstr;$i++) {
  2409.         $pos = rand(0, strlen($char) - 1);
  2410.         $str = "test";echo($str[0]);
  2411.     }
  2412.     return $str;
  2413. };
  2414. function RandChar1($randstr) {
  2415.     $char = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
  2416.     $str = '';
  2417.     for ($i = 0;$i < $randstr;$i++) {
  2418.         $pos = rand(0, strlen($char) - 1);
  2419.         $str = "test";echo($str[0]);
  2420.     }
  2421.     return $str;
  2422. };
  2423. function RandNumber($randstr) {
  2424.     $char = '0123456789';
  2425.     $str = '';
  2426.     for ($i = 0;$i < $randstr;$i++) {
  2427.         $pos = rand(0, strlen($char) - 1);
  2428.         $str = "test";echo($str[0]);
  2429.     }
  2430.     return $str;
  2431. };
  2432. function lettering($msgfile, $email, $frommail, $fromname, $randurl, $subject) {
  2433.     $randip = "" . rand(100, 254) . "." . rand(1, 254) . "." . rand(1, 254) . "." . rand(1, 254) . "";
  2434.     $randstr = RandString(10);
  2435.     $randstr1 = RandString1(10);
  2436.     $randnumber1 = RandNumber(1);
  2437.     $randnumber2 = RandNumber(2);
  2438.     $randnumber3 = RandNumber(3);
  2439.     $randnumber4 = RandNumber(4);
  2440.     $randnumber5 = RandNumber(5);
  2441.     $randnumber6 = RandNumber(6);
  2442.     $randnumber7 = RandNumber(7);
  2443.     $randnumber8 = RandNumber(8);
  2444.     $randnumber9 = RandNumber(9);
  2445.     $randnumber10 = RandNumber(10);
  2446.     $randchar1 = RandChar(1);
  2447.     $randchar2 = RandChar(2);
  2448.     $randchar3 = RandChar(3);
  2449.     $randchar4 = RandChar(4);
  2450.     $randchar5 = RandChar(5);
  2451.     $randchar6 = RandChar(6);
  2452.     $randchar7 = RandChar(7);
  2453.     $randchar8 = RandChar(8);
  2454.     $randchar9 = RandChar(9);
  2455.     $randchar10 = RandChar(10);
  2456.     $randchar11 = RandChar1(1);
  2457.     $randchar12 = RandChar1(2);
  2458.     $randchar13 = RandChar1(3);
  2459.     $randchar14 = RandChar1(4);
  2460.     $randchar15 = RandChar1(5);
  2461.     $randchar16 = RandChar1(6);
  2462.     $randchar17 = RandChar1(7);
  2463.     $randchar18 = RandChar1(8);
  2464.     $randchar19 = RandChar1(9);
  2465.     $randchar110 = RandChar1(10);
  2466.     shuffle($randurl);
  2467.     $randurls = array_shift($randurl);
  2468.     $PC_OS_arr = array('Windows 10', 'Windows 7', 'Windows XP', 'Mac OS X',);
  2469.     shuffle($PC_OS_arr);
  2470.     $PC_OS = array_shift($PC_OS_arr);
  2471.     $PC_Browser_arr = array('Internet Explorer', 'Firefox', 'Safari', 'Chrome', 'Opera',);
  2472.     shuffle($PC_Browser_arr);
  2473.     $PC_browser = array_shift($PC_Browser_arr);
  2474.     $countries = array("Argentina", "Australia", "Austria", "Belgium", "Brazil", "Canada", "Chile", "China", "Colombia", "Costa Rica", "Cuba", "Czech Republic", "Denmark", "Egypt", "Finland", "France", "Germany", "Ghana", "Greece", "Honduras", "Hong Kong", "Hungary", "Iceland", "India", "Indonesia", "Ireland", "Israel", "Italy", "Japan", "Korea, Republic of", "Luxembourg", "Macau", "Malaysia", "Mexico", "Myanmar", "Netherlands", "New Zealand", "Norway", "Paraguay", "Peru", "Philippines", "Poland", "Portugal", "Puerto Rico", "Qatar", "Romania", "Russian Federation", "Saudi Arabia", "Senegal", "Singapore", "Slovenia", "South Africa", "Spain", "Sweden", "Switzerland", "Thailand", "Tunisia", "Turkey", "Ukraine", "United Arab Emirates", "United Kingdom", "United States", "Uruguay", "Uzbekistan", "Venezuela", "Vietnam",);
  2475.     shuffle($countries);
  2476.     $country = array_shift($countries);
  2477.     $countries_details_arr = array("Abu Dhabi,United Arab Emirates", "Abuja,Nigeria", "Accra,Ghana", "Adamstown,Pitcairn", "Addis Ababa,Ethiopia", "Algiers,Algeria", "Alofi,Niue", "Amman,Jordan", "Amsterdam,Netherlands", "Andorra la Vella,Andorra", "Ankara,Turkey", "Antananarivo,Madagascar", "Apia,Samoa", "Ashgabat,Turkmenistan", "Asmara,Eritrea", "Astana,Kazakhstan", "Asunción,Paraguay", "Athens,Greece", "Avarua,Cook Islands", "Baghdad,Iraq", "Baku,Azerbaijan", "Bamako,Mali", "Bandar Seri Begawan,Brunei", "Bangkok,Thailand", "Bangui,Central African Republic", "Banjul,Gambia", "Basse-Terre,Guadeloupe", "Basseterre,Saint Kitts and Nevis", "Beijing,China", "Beirut,Lebanon", "Belgrade,Serbia", "Belmopan,Belize", "Berlin ,Germany", "Bern,Switzerland", "Bishkek,Kyrgyzstan", "Bissau,Guinea-Bissau", "Bogotá,Colombia", "Brasília,Brazil", "Bratislava,Slovakia", "Brazzaville,Republic of the Congo", "Bridgetown,Barbados", "Brussels,Belgium", "Bucharest,Romania", "Budapest,Hungary", "Buenos Aires,Argentina", "Bujumbura,Burundi", "Cairo,Egypt", "Canberra,Australia", "Caracas,Venezuela", "Castries,Saint Lucia", "Cayenne,French Guiana", "Charlotte Amalie,United States Virgin Islands", "Chișinău,Moldova", "Cockburn Town,Turks and Caicos Islands", "Conakry,Guinea", "Copenhagen,Denmark", "Dakar,Senegal", "Damascus,Syria", "Dhaka,Bangladesh", "Dili,East Timor", "Djibouti,Djibouti", "Dodoma ,Tanzania", "Doha,Qatar", "Douglas,Isle of Man", "Dublin,Ireland", "Dushanbe,Tajikistan", "Edinburgh of the Seven Seas,Tristan da Cunha", "El Aioun,Sahrawi Arab Democratic Republic", "Episkopi Cantonment,Akrotiri and Dhekelia", "Fort-de-France,Martinique", "Freetown,Sierra Leone", "Funafuti,Tuvalu", "Gaborone,Botswana", "George Town,Cayman Islands", "Georgetown,Ascension Island", "Georgetown,Guyana", "Gibraltar,Gibraltar", "Grozny,Chechnya", "Guatemala City,Guatemala", "Gustavia,Saint Barthélemy", "Hagåtña,Guam", "Hamilton,Bermuda", "Hanga Roa,Easter Island", "Hanoi,Vietnam", "Harare,Zimbabwe", "Hargeisa,Somaliland", "Havana,Cuba", "Helsinki,Finland", "Hong Kong,Hong Kong", "Honiara,Solomon Islands", "Islamabad,Pakistan", "Jakarta,Indonesia", "Jamestown,Saint Helena", "Jerusalem ,Israel", "Juba,South Sudan", "Kabul,Afghanistan", "Kampala,Uganda", "Kathmandu,Nepal", "Khartoum,Sudan", "Kiev,Ukraine", "Kigali,Rwanda", "King Edward Point,South Georgia and the South Sandwich Islands", "Kingston,Jamaica", "Kingston,Norfolk Island", "Kingstown,Saint Vincent and the Grenadines", "Kinshasa,Democratic Republic of the Congo", "Kuala Lumpur,Malaysia", "Kuwait City,Kuwait", "Libreville,Gabon", "Lilongwe,Malawi", "Lima,Peru", "Lisbon,Portugal", "Ljubljana,Slovenia", "Lomé,Togo", "London,United Kingdom", "Luanda,Angola", "Lusaka,Zambia", "Luxembourg,Luxembourg", "Madrid,Spain", "Majuro,Marshall Islands", "Malabo,Equatorial Guinea", "Malé,Maldives", "Mamoudzou,Mayotte", "Managua,Nicaragua", "Manama,Bahrain", "Manila,Philippines", "Maputo,Mozambique", "Marigot,Saint Martin", "Maseru,Lesotho", "Mata-Utu,Wallis and Futuna", "Mbabane,Swaziland", "Mexico City,Mexico", "Minsk,Belarus", "Mogadishu,Somalia", "Monaco,Monaco", "Monrovia,Liberia", "Montevideo,Uruguay", "Moroni,Comoros", "Moscow,Russia", "Muscat,Oman", "Nairobi,Kenya", "Nassau,Bahamas", "Naypyidaw,Myanmar", "N'Djamena,Chad", "New Delhi,India", "Ngerulmud,Palau", "Niamey,Niger", "Nicosia,Cyprus", "Nicosia,Northern Cyprus", "Nouakchott,Mauritania", "Nouméa,New Caledonia", "Nukuʻalofa,Tonga", "Nuuk,Greenland", "Oranjestad,Aruba", "Oslo,Norway", "Ottawa,Canada", "Ouagadougou,Burkina Faso", "Pago Pago,American Samoa", "Palikir,Federated States of Micronesia", "Panama City,Panama", "Papeete,French Polynesia", "Paramaribo,Suriname", "Paris,France", "Philipsburg,Sint Maarten", "Phnom Penh,Cambodia", "Plymouth ,Montserrat", "Podgorica ,Montenegro", "Port Louis,Mauritius", "Port Moresby,Papua New Guinea", "Port Vila,Vanuatu", "Port-au-Prince,Haiti", "Port of Spain,Trinidad and Tobago", "Porto-Novo,Benin", "Prague,Czech Republic", "Praia,Cape Verde", "Pretoria ,South Africa", "Pristina,Kosovo[g]", "Pyongyang,North Korea", "Quito,Ecuador", "Rabat,Morocco", "Ramallah,State of Palestine", "Reykjavík,Iceland", "Riga,Latvia", "Riyadh,Saudi Arabia", "Road Town,British Virgin Islands", "Rome,Italy", "Roseau,Dominica", "Saint-Denis,Réunion", "Saipan,Northern Mariana Islands", "San José,Costa Rica", "San Juan,Puerto Rico", "San Marino,San Marino", "San Salvador,El Salvador", "Sana'a,Yemen", "Santiago,Chile", "Santo Domingo,Dominican Republic", "São Tomé,São Tomé and Príncipe", "Sarajevo,Bosnia and Herzegovina", "Seoul,South Korea", "Singapore,Singapore", "Skopje,Republic of Macedonia", "Sofia,Bulgaria", "Sri Jayawardenepura Kotte,Sri Lanka", "St. George's,Grenada", "St. Helier,Jersey", "St. John's,Antigua and Barbuda", "St. Peter Port,Guernsey", "St. Pierre,Saint Pierre and Miquelon", "Stanley,Falkland Islands", "Stepanakert,Artsakh", "Stockholm,Sweden", "Sucre,Bolivia", "Sukhumi,Abkhazia", "Suva,Fiji", "Taipei,Taiwan", "Tallinn,Estonia", "Tarawa,Kiribati", "Tashkent,Uzbekistan", "Tbilisi,Georgia", "Tegucigalpa,Honduras", "Tehran,Iran", "Thimphu,Bhutan", "Tirana,Albania", "Tiraspol,Transnistria", "Tokyo,Japan", "Tórshavn,Faroe Islands", "Tripoli,Libya", "Tskhinvali,South Ossetia", "Tunis,Tunisia", "Ulaanbaatar,Mongolia", "Vaduz,Liechtenstein", "Valletta,Malta", "The Valley,Anguilla", "Vatican City,Vatican City", "Victoria,Seychelles", "Vienna,Austria", "Vientiane,Laos", "Vilnius,Lithuania", "Warsaw,Poland", "Washington, D.C.,United States", "Wellington,New Zealand", "West Island,Cocos", "Willemstad,Curaçao", "Windhoek,Namibia", "Yamoussoukro,Ivory Coast", "Yaoundé,Cameroon", "Yaren,Nauru", "Yerevan,Armenia", "Zagreb,Croatia");
  2478.     shuffle($countries_details_arr);
  2479.     $countrycity = array_shift($countries_details_arr);
  2480.     $Android_OS_arr = array('Android 4.0 Ice Cream Sandwich', 'Android 4.1 Jelly Bean', 'Android 4.4 KitKat', 'Android 5.0 Lollipop', 'Android 6.0 Marshmallow',);
  2481.     shuffle($Android_OS_arr);
  2482.     $Android_OS = array_shift($Android_OS_arr);
  2483.     $Android_Browser_arr = array('Firefox', 'Google Chrome ', 'Opera Mini',);
  2484.     shuffle($Android_Browser_arr);
  2485.     $Android_Browser = array_shift($Android_Browser_arr);
  2486.     $UA_arr = array('Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.1 Safari/537.36', 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.0 Safari/537.36', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.0 Safari/537.36', 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2226.0 Safari/537.36', 'Mozilla/5.0 (Windows NT 6.4; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2225.0 Safari/537.36', 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2225.0 Safari/537.36', 'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2224.3 Safari/537.36', 'Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.93 Safari/537.36', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.124 Safari/537.36', 'Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2049.0 Safari/537.36', 'Mozilla/5.0 (Windows NT 4.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2049.0 Safari/537.36', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.67 Safari/537.36', 'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.67 Safari/537.36', 'Mozilla/5.0 (X11; OpenBSD i386) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1944.0 Safari/537.36', 'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.3319.102 Safari/537.36', 'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.2309.372 Safari/537.36', 'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.2117.157 Safari/537.36', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.47 Safari/537.36', 'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1866.237 Safari/537.36', 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.137 Safari/4E423F', 'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.116 Safari/537.36 Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10', 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.517 Safari/537.36', 'Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1667.0 Safari/537.36', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1664.3 Safari/537.36', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1664.3 Safari/537.36', 'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.16 Safari/537.36', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1623.0 Safari/537.36', 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.17 Safari/537.36', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.62 Safari/537.36', 'Mozilla/5.0 (X11; CrOS i686 4319.74.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.57 Safari/537.36', 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.2 Safari/537.36', 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1468.0 Safari/537.36', 'Mozilla/5.0 (Windows NT 6.2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1467.0 Safari/537.36', 'Mozilla/5.0 (Windows NT 6.2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1464.0 Safari/537.36', 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1500.55 Safari/537.36', 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.93 Safari/537.36', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.93 Safari/537.36', 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.93 Safari/537.36', 'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.93 Safari/537.36', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.93 Safari/537.36', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.93 Safari/537.36', 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.90 Safari/537.36', 'Mozilla/5.0 (X11; NetBSD) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.116 Safari/537.36', 'Mozilla/5.0 (X11; CrOS i686 3912.101.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.116 Safari/537.36', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.60 Safari/537.17', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1309.0 Safari/537.17', 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.15 (KHTML, like Gecko) Chrome/24.0.1295.0 Safari/537.15', 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.14 (KHTML, like Gecko) Chrome/24.0.1292.0 Safari/537.14', 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.13 (KHTML, like Gecko) Chrome/24.0.1290.1 Safari/537.13', 'Mozilla/5.0 (Windows NT 6.2) AppleWebKit/537.13 (KHTML, like Gecko) Chrome/24.0.1290.1 Safari/537.13', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.13 (KHTML, like Gecko) Chrome/24.0.1290.1 Safari/537.13', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/537.13 (KHTML, like Gecko) Chrome/24.0.1290.1 Safari/537.13', 'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.6 Safari/537.11', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.6 Safari/537.11', 'Mozilla/5.0 (Windows NT 6.2) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.26 Safari/537.11', 'Mozilla/5.0 (Windows NT 6.0) yi; AppleWebKit/345667.12221 (KHTML, like Gecko) Chrome/23.0.1271.26 Safari/453667.1221', 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.17 Safari/537.11', 'Mozilla/5.0 (Windows NT 6.2) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.94 Safari/537.4', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_0) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.79 Safari/537.4', 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.2 (KHTML, like Gecko) Chrome/22.0.1216.0 Safari/537.2', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/22.0.1207.1 Safari/537.1', 'Mozilla/5.0 (X11; CrOS i686 2268.111.0) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.57 Safari/536.11', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.6 (KHTML, like Gecko) Chrome/20.0.1092.0 Safari/536.6', 'Mozilla/5.0 (Windows NT 6.2) AppleWebKit/536.6 (KHTML, like Gecko) Chrome/20.0.1090.0 Safari/536.6', 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/19.77.34.5 Safari/537.1', 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.9 Safari/536.5', 'Mozilla/5.0 (X11; FreeBSD amd64) AppleWebKit/536.5 (KHTML like Gecko) Chrome/19.0.1084.56 Safari/1EA69', 'Mozilla/5.0 (Windows NT 6.0) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.36 Safari/536.5', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.3 (KHTML, like Gecko) Chrome/19.0.1063.0 Safari/536.3', 'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/536.3 (KHTML, like Gecko) Chrome/19.0.1063.0 Safari/536.3', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_0) AppleWebKit/536.3 (KHTML, like Gecko) Chrome/19.0.1063.0 Safari/536.3', 'Mozilla/5.0 (Windows NT 6.2) AppleWebKit/536.3 (KHTML, like Gecko) Chrome/19.0.1062.0 Safari/536.3', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.3 (KHTML, like Gecko) Chrome/19.0.1062.0 Safari/536.3', 'Mozilla/5.0 (Windows NT 6.2) AppleWebKit/536.3 (KHTML, like Gecko) Chrome/19.0.1061.1 Safari/536.3', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.3 (KHTML, like Gecko) Chrome/19.0.1061.1 Safari/536.3', 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/536.3 (KHTML, like Gecko) Chrome/19.0.1061.1 Safari/536.3', 'Mozilla/5.0 (Windows NT 6.2) AppleWebKit/536.3 (KHTML, like Gecko) Chrome/19.0.1061.0 Safari/536.3', 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.24 (KHTML, like Gecko) Chrome/19.0.1055.1 Safari/535.24', 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/535.24 (KHTML, like Gecko) Chrome/19.0.1055.1 Safari/535.24', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/535.24 (KHTML, like Gecko) Chrome/19.0.1055.1 Safari/535.24', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.22 (KHTML, like Gecko) Chrome/19.0.1047.0 Safari/535.22', 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.21 (KHTML, like Gecko) Chrome/19.0.1042.0 Safari/535.21', 'Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.21 (KHTML, like Gecko) Chrome/19.0.1041.0 Safari/535.21', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.20 (KHTML, like Gecko) Chrome/19.0.1036.7 Safari/535.20', 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/18.6.872.0 Safari/535.2 UNTRUSTED/1.0 3gpp-gba UNTRUSTED/1.0', 'Mozilla/5.0 (Macintosh; AMD Mac OS X 10_8_2) AppleWebKit/535.22 (KHTML, like Gecko) Chrome/18.6.872', 'Mozilla/5.0 (X11; CrOS i686 1660.57.0) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.46 Safari/535.19', 'Mozilla/5.0 (Windows NT 6.0; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.45 Safari/535.19', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.45 Safari/535.19', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.45 Safari/535.19', 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.66 Safari/535.11', 'Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.66 Safari/535.11', 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.66 Safari/535.11', 'Mozilla/5.0 (Windows NT 6.2) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.66 Safari/535.11', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.66 Safari/535.11', 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.66 Safari/535.11', 'Mozilla/5.0 (Windows NT 6.0; WOW64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.66 Safari/535.11', 'Mozilla/5.0 (Windows NT 6.0) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.66 Safari/535.11', 'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.66 Safari/535.11', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.66 Safari/535.11', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.66 Safari/535.11', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.66 Safari/535.11', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_5_8) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.66 Safari/535.11', 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.11 (KHTML, like Gecko) Ubuntu/11.10 Chromium/17.0.963.65 Chrome/17.0.963.65 Safari/535.11', 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.11 (KHTML, like Gecko) Ubuntu/11.04 Chromium/17.0.963.65 Chrome/17.0.963.65 Safari/535.11', 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.11 (KHTML, like Gecko) Ubuntu/10.10 Chromium/17.0.963.65 Chrome/17.0.963.65 Safari/535.11', 'Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.11 (KHTML, like Gecko) Ubuntu/11.10 Chromium/17.0.963.65 Chrome/17.0.963.65 Safari/535.11', 'Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.65 Safari/535.11', 'Mozilla/5.0 (X11; FreeBSD amd64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.65 Safari/535.11', 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.65 Safari/535.11', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.65 Safari/535.11', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_0) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.65 Safari/535.11', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_4) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.65 Safari/535.11', 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.11 (KHTML, like Gecko) Ubuntu/11.04 Chromium/17.0.963.56 Chrome/17.0.963.56 Safari/535.11', 'Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11', 'Mozilla/5.0 (Windows NT 6.0; WOW64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11', 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.12 Safari/535.11', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.8 (KHTML, like Gecko) Chrome/17.0.940.0 Safari/535.8', 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.77 Safari/535.7ad-imcjapan-syosyaman-xkgi3lqg03!wgz', 'Mozilla/5.0 (X11; CrOS i686 1193.158.0) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.75 Safari/535.7', 'Mozilla/5.0 (Windows NT 6.0; WOW64) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.75 Safari/535.7', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.63 Safari/535.7xs5D9rRDFpg2g', 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.8 (KHTML, like Gecko) Chrome/16.0.912.63 Safari/535.8', 'Mozilla/5.0 (Windows NT 5.2; WOW64) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.63 Safari/535.7');
  2487.     shuffle($UA_arr);
  2488.     $UA = array_shift($UA_arr);
  2489.     $Apple_Apps_arr = array('iMessage', 'iCloud', 'FaceTime', 'iThunes', 'Apple Photos', 'Find My Phone');
  2490.     shuffle($Apple_Apps_arr);
  2491.     $Apple_Apps = array_shift($Apple_Apps_arr);
  2492.     $Apple_Device_Desktop_Arr = array('MacBookPro5,5', 'MacBookPro5,3', 'MacBookPro5,2', 'MacBookPro7,1', 'MacBookPro6,1', 'MacBookPro6,2', 'MacBookPro8,1', 'MacBookPro8,2', 'MacBookPro8,3', 'MacBookPro9,1', 'MacBookPro9,2', 'MacBookPro10,1', 'MacBookPro10,2', 'MacBookPro11,1', 'MacBookPro11,2', 'MacBookPro11,3', 'MacBookPro11,4', 'MacBookPro11,5', 'MacBookPro13,1', 'MacBookPro13,2', 'MacBookPro13,3', 'MacBookPro14,1', 'MacBookPro14,2', 'MacBookPro14,3');
  2493.     shuffle($Apple_Device_Desktop_Arr);
  2494.     $Apple_Device_Desktop = array_shift($Apple_Device_Desktop_Arr);
  2495.     $Apple_Phone_arr = array('iPhone 4', 'iPhone 4S', 'iPhone 5', 'iPhone 5c', 'iPhone 5s', 'iPhone 6', 'iPhone 6 Plus', 'iPhone 6s', 'iPhone 6s Plus', 'iPhone SE', 'iPhone 7', 'iPhone 7 Plus', 'iPhone 8', 'iPhone 8 Plus', 'iPhone X');
  2496.     shuffle($Apple_Phone_arr);
  2497.     $Apple_Phone = array_shift($Apple_Phone_arr);
  2498.     $List_Browser_arr = array('Google Chrome', 'Mozilla Firefox', 'Safari', 'Opera', 'Internet Explorer',);
  2499.     shuffle($List_Browser_arr);
  2500.     $List_Browser = array_shift($List_Browser_arr);
  2501.     $parts = explode("@", $email);
  2502.     $usernameemail = $parts[0];
  2503.     $domainemailfull = substr(strrchr($email, "@"), 1);
  2504.     $domainemailfullbefore = substr(strrchr($email, "@"), 1);
  2505.     $domainemailfullarray = explode(".", $domainemailfullbefore);
  2506.     $domainemail = $domainemailfullarray[0];
  2507.     $date = date('F d, Y, h:i A');
  2508.     $file = file_get_contents($msgfile);
  2509.     $arr = array('[EMAIL]', '[SUBJECT]', '[RANDOMIP]', '[FROMMAIL]', '[FROMNAME]', '##LINK##', '[randstring]', '[RANDSTRING]', '[COUNTRY]', '[DATE]', '[NUMBER1]', '[NUMBER2]', '[NUMBER3]', '[NUMBER4]', '[NUMBER5]', '[NUMBER6]', '[NUMBER7]', '[NUMBER8]', '[NUMBER9]', '[NUMBER10', '[char1]', '[char2]', '[char3]', '[char4]', '[char5]', '[char6]', '[char7]', '[char8]', '[char9]', '[char10]', '[CHAR1]', '[CHAR2]', '[CHAR3]', '[CHAR4]', '[CHAR5]', '[CHAR6]', '[CHAR7]', '[CHAR8]', '[CHAR9]', '[CHAR10]', '[PC_OS]', '[PC_Browser]', '[COUNTRYCITY]', '[ANDROID_OS]', '[ANDROID_Browser]', '[UA]', '[APPLEAPPS]', '[APPLEPC]', '[APPLEPHONES]', '[UNIVERSAL_Browser]', '[USERNAME]', '[DOMAIN]', '[DOMAINFULL]',);
  2510.     $new = array('' . $email . '', '' . $subject . '', '' . $randip . '', '' . $frommail . '', '' . $fromname . '', '' . $randurls . '', '' . $randstr . '', '' . $randstr1 . '', '' . $country . '', '' . $date . '', '' . $randnumber1 . '', '' . $randnumber2 . '', '' . $randnumber3 . '', '' . $randnumber4 . '', '' . $randnumber5 . '', '' . $randnumber6 . '', '' . $randnumber7 . '', '' . $randnumber8 . '', '' . $randnumber9 . '', '' . $randnumber10 . '', '' . $randchar1 . '', '' . $randchar2 . '', '' . $randchar3 . '', '' . $randchar4 . '', '' . $randchar5 . '', '' . $randchar6 . '', '' . $randchar7 . '', '' . $randchar8 . '', '' . $randchar9 . '', '' . $randchar10 . '', '' . $randchar11 . '', '' . $randchar12 . '', '' . $randchar13 . '', '' . $randchar14 . '', '' . $randchar15 . '', '' . $randchar16 . '', '' . $randchar17 . '', '' . $randchar18 . '', '' . $randchar19 . '', '' . $randchar110 . '', '' . $PC_OS . '', '' . $PC_browser . '', '' . $countrycity . '', '' . $Android_OS . '', '' . $Android_Browser . '', '' . $UA . '', '' . $Apple_Apps . '', '' . $Apple_Device_Desktop . '', '' . $Apple_Phone . '', '' . $List_Browser . '', '' . $usernameemail . '', '' . $domainemail . '', '' . $domainemailfull . '',);
  2511.     $repl = str_replace($arr, $new, $file, $subject);
  2512.     return $repl;
  2513. };
  2514. function Reletter($letter, $mailto) {
  2515.     $file = file_get_contents($letter);
  2516.     $arr = array('##email##');
  2517.     $new = array('' . $mailto . '');
  2518.     $repl = str_replace($arr, $new, $file);
  2519.     return $repl;
  2520. };
  2521. function berhenti($kata) {
  2522.     $k = strlen($kata);
  2523.     if ($k == $k) {
  2524.         $p = substr($kata, $k - 1);
  2525.         if ($p == 0) {
  2526.             echo "Break for 4 seconds...\n";
  2527.             sleep(4);
  2528.         }
  2529.     }
  2530. }
  2531. function Savedata($file, $data) {
  2532.     $file = fopen($file, "w");
  2533.     fputs($file, PHP_EOL . $data);
  2534.     return fclose($file);
  2535. };
  2536. function RemoveLine($file, $name) {
  2537.     $getfile = file_get_contents($file);
  2538.     $search = explode($name, $getfile);
  2539.     $save = $search[0];
  2540.     $savedata = Savedata($file, $save);
  2541.     return $savedata;
  2542. };
  2543. include ('_CONFIG/settings.php');
  2544. include ('_SETTING/RANDOM.php');
  2545. include ('_SETTING/.header');
  2546. echo "                                                                                            \r\n";
  2547. $yearnow = date("Y");
  2548. $monow = date("M");
  2549. if ($yearnow == 2019) {
  2550.     if ($monow == "Mar") {
  2551.     } else {
  2552.         echo "                                                                        \r\n";
  2553.         die();
  2554.     }
  2555. } else {
  2556.     echo "                                                                        \r\n";
  2557.     echo "                                                                        \r\n";
  2558.  
  2559.     
  2560. }
  2561.  
  2562. function Kirim($email, $smtpsettings, $setupsettings) {
  2563.     $smtp = new SMTP;
  2564.     $smtp->do_debug = 0;
  2565.     $smtpserver = $smtpsettings['HOST'];
  2566.     $smtpport = $smtpsettings['PORT'];
  2567.     $smtpuser = $smtpsettings['USERNAME'];
  2568.     $smtppass = $smtpsettings['PASSWORD'];
  2569.     $userandom = $setupsettings['USER_RANDOM'];
  2570.     $sleeptime = $setupsettings['SLEEP_TIME'];
  2571.     $delaylimit = $setupsettings['DELAY_LIMIT'];
  2572.     $maillimit = $setupsettings['MAIL_LIMIT'];
  2573.     $priority = $setupsettings['PRIORITY'];
  2574.     $replacement = 1;
  2575.     $userremoveline = $setupsettings['REMOVE_LINE'];
  2576.     $fromname = $setupsettings['FROM_NAME'];
  2577.     $frommail = $setupsettings['FROM_MAIL'];
  2578.     $subject = $setupsettings['SUBJECT'];
  2579.     $msgfile = $setupsettings['LETTER'];
  2580.     $filedir = $setupsettings['FILE_ATTACHMENT'];
  2581.     $randurl = $setupsettings['LINK'];
  2582.     $time = $setupsettings['TIME'];
  2583.     $filesend = $setupsettings['SEND_ATTACHMENT'];
  2584.     $nameattachment = $setupsettings['NAME_ATTACHMENT'];
  2585.     $replytoemail = $setupsettings['REPLY-TO_EMAIL'];
  2586.     $replyto = $setupsettings['REPLY-TO'];
  2587.     $maskingfrommail = $setupsettings['MASK-FROM_MAIL'];
  2588.     $no = 1;
  2589.     $nomail = 1;
  2590.     $hitung = 1;
  2591.     if (!$smtp->connect($smtpserver, $smtpport)) {
  2592.         throw new Exception('smtp host connection failed; check .settings');
  2593.     }
  2594.     if (!$smtp->hello(gethostname())) {
  2595.         throw new Exception('EHLO failed: ' . $smtp->getError() ['error']);
  2596.     }
  2597.     $e = $smtp->getServerExtList();
  2598.     if (array_key_exists('STARTTLS', $e)) {
  2599.         $tlsok = $smtp->startTLS();
  2600.         if (!$tlsok) {
  2601.             throw new Exception('Failed to start encryption: ' . $smtp->getError() ['error']);
  2602.         }
  2603.         if (!$smtp->hello(gethostname())) {
  2604.             throw new Exception('EHLO (2) failed: ' . $smtp->getError() ['error']);
  2605.         }
  2606.         $e = $smtp->getServerExtList();
  2607.     }
  2608.     if (array_key_exists('AUTH', $e)) {
  2609.         if ($smtp->authenticate($smtpuser, $smtppass)) {
  2610.             $mail = new PHPMailer;
  2611.             $mail->Encoding = 'base64';
  2612.             $mail->CharSet = 'UTF-8';
  2613.             $mail->headerLine("format", "flowed");
  2614.             $mail->IsSMTP();
  2615.             $mail->SMTPAuth = true;
  2616.             $mail->Host = $smtpserver;
  2617.             $mail->Port = $smtpport;
  2618.             $mail->Priority = $priority;
  2619.             $mail->Username = $smtpuser;
  2620.             $mail->Password = $smtppass;
  2621.             if ($userandom == 1) {
  2622.                 $rand = rand(1, 50);
  2623.                 $fromname = Random_Name($rand);
  2624.                 $frommail = Random_Mail($rand);
  2625.                 $subject = Random_Subject($rand);
  2626.             }
  2627.                         if ($setupsettings['SEND_ATTACHMENT'] == 1) {
  2628.                                 $filedir = str_replace('##email##',$email,file_get_contents($setupsettings['FILE_ATTACHMENT']));
  2629.                                 $nameattachment = str_replace('##email##', $email, $setupsettings['NAME_ATTACHMENT']);
  2630.                                 $mail->addStringAttachment($filedir, $nameattachment, 'base64', 'application/octetstream');
  2631.             }
  2632.             $asu = RandString(8);
  2633.             $asu1 = RandString(5);
  2634.             $asu2 = RandString(5);
  2635.             $asuu = RandString(8);
  2636.             $asuu1 = RandString(5);
  2637.             $asuu2 = RandString(5);
  2638.             $nmbr = RandNumber(5);
  2639.             date_default_timezone_set('America/Adak');
  2640.             $timecombination = date('F d, Y, h:i A');
  2641.             $fromnames = str_replace('##RANDSTRING##', $asuu1, $fromname);
  2642.             $frommails = str_replace('##RANDSTRING##', $asuu, $frommail);
  2643.             $subjects = str_replace('##DATE##', $timecombination, $subject);
  2644.             if ($maskingfrommail == 1) {
  2645.                 $frommails = $smtpuser;
  2646.             }
  2647.             if ($replyto == 1) {
  2648.                 $mail->AddReplyTo($replytoemail);
  2649.             }
  2650.             $mail->setFrom($frommails, $fromnames);
  2651.             $mail->AddAddress($email);
  2652.             $mail->Subject = $subjects;
  2653.             if ($replacement == 1) {
  2654.                 $msg = lettering($msgfile, $email, $frommail, $fromname, $randurl, $subject);
  2655.             } else {
  2656.                 $msg = file_get_contents($msgfile);
  2657.             }
  2658.             $mail->msgHTML($msg);
  2659.             if (!$mail->send()) {
  2660.                 echo "SMTP Error : " . $mail->ErrorInfo;
  2661.                 exit();
  2662.             } else {
  2663.                 
  2664.                 echo " ★ \033[;33m▄︻デ//══━一 $email \033[1:3m \r\n";
  2665.                 echo " ★ Status\033[0m       : \033[0;33mSuccessful!\033[0m\n";
  2666.             }
  2667.             $mail->clearAddresses();
  2668.         } else {
  2669.             throw new Exception('invalid smtp username & password: ');
  2670.         }
  2671.     }
  2672. }
  2673.  
  2674.     $file = file_get_contents($setupsettings['EMAILIST']);
  2675.     if ($file) {
  2676.         $ext = preg_split('/\n|\r\n?/', $file);
  2677.         $hitung = 0;
  2678.       
  2679.         echo "\e[0m\e[1;31m           _________ .__            __            \e[0:33m\r\n";
  2680.         echo "★\e[0m\e[1;31m         \_   ___ \|  |__   _____/  |_  ____    \e[0;33m\r\n";
  2681.         echo "★\e[0m\e[1;31m         /    \  \/|  |  \_/ __ \   __\/  _ \   \e[0;33m\r\n";
  2682.         echo "★\e[0m\e[1;31m         \     \___|   Y  \  ___/|  | (  <_> )  \e[0;31m\r\n";
  2683.         echo "★\e[0m\e[1;31m          \______  /___|  /\___  >__|  \____/   \e[0;31m\r\n";
  2684.         echo "★\e[0m\e[1;31m                 \/     \/     \/               \e[0;33m\r\n";                                        
  2685.         echo "★\e[0m\e[1;33m                  ╔═╗╔═╗╔╗╔╔╦╗╔═╗╦═╗            \e[0;33m\r\n";
  2686.         echo "★\e[0m\e[1;33m                  ╚═╗╠╣ ║║║ ║║╠╣ ╠╦╝            \e[0;31m\r\n";
  2687.         echo "★\e[0m\e[1;33m                  ╚═╝╚═╝╝╚╝═╩╝╚═╝╩╚═            \e[0;33m\r\n";
  2688.         echo "???????????? ????????????????????????        \033[1;32m???????????????????? \033[0m \r\n";
  2689.         echo "                         \033[0;33m ★★★ \033[0m     \r\n";
  2690.         ????????????:
  2691.         echo "\033[0m???????????????????????? ????????????????????\033[0m                 \r\n";
  2692.         echo "\033[1;33m????????????:Telegram:Ninja111 \033[0m  \r\n";
  2693.         
  2694.         $smtp_key = 0;
  2695.         $maillimithitung = 0;
  2696.         foreach ($ext as $num => $email) {
  2697.             if ($smtp_key == count($smtpsettings)) {
  2698.                 $smtp_key = 0;
  2699.             }
  2700.             Kirim($email, $smtpsettings[$smtp_key], $setupsettings);
  2701.             $smtp_key++;
  2702.             sleep($setupsettings['SLEEP_TIME']);
  2703.             $maillimithitung++;
  2704.             $hitung++;
  2705.             if ($setupsettings['REMOVE_LINE'] == 1) {
  2706.                 $remove = RemoveLine($setupsettings['EMAILIST'], $email);
  2707.             }
  2708.             if ($maillimithitung == $setupsettings['MAIL_LIMIT']) {
  2709.                 echo \\\ [ Delay in " . $setupsettings['DELAY_LIMIT'] . " sec ] ║   ║ [ Total Sending " . $hitung . " ] ║ \r\n";
  2710.                 echo \\\                                                                                           \r\n";
  2711.                 sleep($setupsettings['DELAY_LIMIT']);
  2712.                 $maillimithitung = 0;
  2713.             }
  2714.         }
  2715.     }
  2716.  
  2717.  
  2718. ?>
File Description
  • ad
  • PHP Code
  • 08 Apr-2024
  • 138.85 Kb
You can Share it: