Advertisement
Guest User

CHADELLGANTENGKANDISINIAJAGAUSAH KEMANA

a guest
Mar 17th, 2018
493
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.37 KB | None | 0 0
  1. <?php
  2. /**
  3. * @Author: Eka Syahwan
  4. * @Date: 2017-09-14 06:33:28
  5. * @Last Modified by: Eka Syahwan
  6. * @Last Modified time: 2017-12-06 15:19:50
  7. */
  8. require_once 'autoload.php';
  9.  
  10. use PHPMailer\PHPMailer\PHPMailer;
  11. use PHPMailer\PHPMailer\Exception;
  12. require 'modules/src/Exception.php';
  13. require 'modules/src/PHPMailer.php';
  14. require 'modules/src/SMTP.php';
  15.  
  16. class Sendinbox extends Config
  17. {
  18. function __construct()
  19. {
  20. $this->modules = new SendinboxModules;
  21. if(phpversion() < "7.0.0"){
  22. die("PHP ".phpversion()." TIDAK SUPPORT SILAHKAN UPDATE KE PHP 7\r\n");
  23. }
  24. if(!function_exists('curl_init')) {
  25. die('cURL tidak ditemukan ! silahkan install curl');
  26. }
  27.  
  28. $template[0] .= "=========================================\r\n";
  29. $template[0] .= " _______ || Sendinbox ".$this->modules->versi()."\r\n";
  30. $template[0] .= " |== []| || (c) 2017 Bug7sec\r\n";
  31. $template[0] .= " | ==== | || www.bmarket.or.id\r\n";
  32. $template[0] .= " '-------' ||\r\n";
  33. $template[0] .= "=========================================\r\n";
  34.  
  35. $template[1] .= "======================\r\n";
  36. $template[1] .= " __ || Sendinbox ".$this->modules->versi()."\r\n";
  37. $template[1] .= " RECIVED| _] MAILBOX || (c) 2017 Bug7sec\r\n";
  38. $template[1] .= " .--||-----. || www.bmarket.or.id\r\n";
  39. $template[1] .= " | || | (C) ||\r\n";
  40. $template[1] .= "_____|__||_____| ||\r\n";
  41. $template[1] .= " \ | ||\r\n";
  42. $template[1] .= "======================\r\n";
  43.  
  44. $template[2] .= "=========================================\r\n";
  45. $template[2] .= " Time : ".date("h").":".date("m").":".date("s")."\r\n";
  46. $template[2] .= " .'`~~~~~~~~~~~`'. || spammers' time\r\n";
  47. $template[2] .= " ( .'11 12 1'. ) || That second is my result\r\n";
  48. $template[2] .= " | :10 \ 2: | || ===================\r\n";
  49. $template[2] .= " | :9 @-> 3: | || Sendinbox ".$this->modules->versi()."\r\n";
  50. $template[2] .= " | :8 4; | || (c) 2017 Bug7sec\r\n";
  51. $template[2] .= " '. '..7 6 5..' .' || www.bmarket.or.id\r\n";
  52. $template[2] .= " ~-------------~ ||\r\n";
  53. $template[2] .= "=========================================\r\n";
  54.  
  55.  
  56. print_r( $template[rand(0,2) ]);
  57.  
  58. $LoadEmail = $this->modules->stuck("[ Load Email List (list.txt) ] : ");
  59. $du = $this->modules->stuck("[ Send Duplicate Mail (0 = Yes , 1 = No)] : ");
  60. $Priority = $this->modules->stuck("[ Priority (1 = High, 2 = Medium, 3 = Low)] : ");
  61. $debug = $this->modules->stuck("[ Enable Debug (0 = Yes , 1 = No)] : ");
  62.  
  63. $this->listEmail = $this->modules->load($LoadEmail , $du);
  64. $this->smtp_config = null;
  65. $this->sendinboxpr = $Priority;
  66. $this->debug = str_replace("1", "no", str_replace("0", "yes", $debug));
  67. $this->run();
  68. }
  69. function send(){
  70. $mail = new PHPMailer(true);
  71. try {
  72.  
  73. $mail->setLanguage('id', 'modules/language/');
  74.  
  75. if($this->debug == 'yes'){
  76. $mail->SMTPDebug = 3;
  77. }else{
  78. $mail->SMTPDebug = 0;
  79. }
  80.  
  81. $mail->isSMTP();
  82. $mail->Host = $this->smtp_config['smtp_host'];
  83. $mail->SMTPAuth = true;
  84. $mail->SMTPKeepAlive = true;
  85. $mail->Priority = $this->sendinboxpr;
  86. $mail->Username = $this->smtp_config['smtp_user'];
  87. $mail->Password = $this->smtp_config['smtp_pass'];
  88. $mail->SMTPSecure = $this->smtp_config['smtp_secure'];
  89. $mail->Port = $this->smtp_config['smtp_port'];
  90. $mail->From = $this->alias( $this->smtp_config['recipients']['from_email'] , $this->email);
  91. $mail->FromName = $this->alias( $this->smtp_config['recipients']['from_name'] , $this->email);
  92.  
  93. $mail->SMTPOptions = array(
  94. 'ssl' => array(
  95. 'verify_peer' => false,
  96. 'verify_peer_name' => false,
  97. 'allow_self_signed' => true
  98. )
  99. );
  100.  
  101. foreach ($this->smtp_config[content][attachments] as $key => $attfile) {
  102. if($attfile != ""){
  103. $flocation = 'attachments/'.$attfile;
  104. if( file_exists($flocation) ){
  105. $mail->addAttachment('attachments/'.$attfile);
  106. }
  107. }
  108. }
  109.  
  110. $mail->Encoding = 'base64';
  111. $mail->CharSet = 'UTF-8';
  112.  
  113. $mail->AddAddress($this->email);
  114.  
  115. $mail->isHTML(true);
  116. $mail->addCustomHeader('X-EmailType-Id' , $mail->Subject);
  117. $mail->addCustomHeader('X-Sent-To' , $this->email);
  118. $mail->addCustomHeader('X-Attach-Flag' , 'N');
  119. $mail->addCustomHeader('X-Reference' , $mail->From);
  120. $mail->addCustomHeader('X-TXN_ID','custom-value');
  121. $mail->addCustomHeader('X-Business-Group', 'service@paypal.com');
  122. $mail->addCustomHeader('Content-Class', 'urn:content-classes:calendarmessage');
  123. $mail->addCustomHeader('List-Unsubscribe' , '<mailto:unsubscribe@digibuzz24.net/unsubscribe.php?email='.$this->email.'>');
  124. $mail->addCustomHeader('List-Subscribe' , '<mailto:subscribe@digibuzz24.net/subscribe.php?email='.$this->email.'>');
  125. $mail->addCustomHeader('List-Owner' , '<mailto:chadell@digibuzz24.net>');
  126. $content = $this->modules->arrayrandom( $this->smtp_config['content']['format'] );
  127.  
  128. if(!file_exists('letter/'.$content['value'])){
  129. die("[Sendinbox] ============>> Letter Tidak ada <<============\r\n");
  130. }
  131.  
  132. $bodyLetter = $this->alias( file_get_contents('letter/'.$content['value']) , $this->email);
  133. $mail->Subject = $this->alias( $content['key'] , $this->email );
  134. $mail->Body = $this->alias( $bodyLetter , $this->email );
  135.  
  136. $mail->send();
  137.  
  138. $this->modules->save('sendinbox-success.txt',$this->email);
  139. return 'Message has been sent';
  140. } catch (Exception $e) {
  141. $this->modules->save('sendinbox-failed.txt',$this->email);
  142. return $mail->ErrorInfo."\r\n";
  143. }
  144. }
  145. function run(){
  146. $hit = 1;
  147. $num = 1;
  148. $this->sendinbox_config = $this->setting();
  149. $this->smtp_array = $this->smtp();
  150.  
  151.  
  152. foreach ($this->listEmail['list'] as $key => $email) {
  153. $this->smtp_config = $this->modules->arrayrandom( $this->smtp_array )['value'];
  154. if( !empty($email) && !empty($this->smtp_config['smtp_user']) ){
  155.  
  156. $this->email = $email;
  157.  
  158. if(count($this->smtp_array) == 0){
  159. die("[Sendinbox] ============>> SMTP Tidak ada <<============\r\n");
  160. }
  161.  
  162. echo "[Sendinbox][".$hit."/".$this->listEmail['total']."|".count($this->smtp_array)."][".substr($this->smtp_config['smtp_user'], 0,8)."..] ".$email." => ";
  163.  
  164. $send = $this->send();
  165. echo str_replace('Message has been sent', 'success' , $send);
  166.  
  167. if( $send != 'Message has been sent' ){
  168. unset($this->smtp_array[$this->smtp_config['key']]);
  169. }
  170.  
  171.  
  172. if($num == $this->sendinbox_config['number']){
  173. sleep($this->sendinbox_config['delay']);
  174. $num = 0;
  175. }
  176. echo "\r\n";
  177. $num++;
  178. $hit++;
  179.  
  180. }
  181. }
  182.  
  183. }
  184. }
  185. $Sendinbox = new Sendinbox;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement