Advertisement
Guest User

Untitled

a guest
Jul 9th, 2017
567
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.96 KB | None | 0 0
  1. <?php
  2. require 'PHPMailerAutoload.php';
  3.  
  4. $f = file_get_contents("emails");
  5. $f = explode("\n", $f);
  6.  
  7. foreach ($f as $email) {
  8.     $email = explode(":", $email)[0];
  9.  
  10.     $mail = new PHPMailer;
  11.  
  12.     $mail->isSMTP();                                    
  13.     $mail->Host = 'smtp.1and1.com';
  14.     $mail->SMTPAuth = true;                              
  15.     $mail->Username = 'support@confirm-your-account.net';
  16.     $mail->Password = '01274002591';
  17.     $mail->SMTPSecure = 'tls';
  18.     $mail->Port = 587;
  19.     $mail->CharSet  =  'utf-8';
  20.     $mail->setFrom('support@souq.com', 'Souq.com');
  21.     $mail->addAddress($email);
  22.     $mail->isHTML(true);                                  
  23.     $mail->Subject = 'تأكيد عملية شراء ﻻبتوب من سوق دوت كوم';
  24.     $mail->Body    = file_get_contents("test2.html");
  25.  
  26.     if(!$mail->send()) {
  27.         echo 'Message could not be sent.';
  28.         echo 'Mailer Error: ' . $mail->ErrorInfo;
  29.     } else {
  30.         echo  $email . ' => Message has been sent' . "\n";
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement