Guest User

Untitled

a guest
Apr 21st, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.60 KB | None | 0 0
  1. <?php
  2. set_time_limit(0);
  3. include 'Mail.php';
  4.  
  5. $host = "localhost";
  6. $username = "username";  
  7. $password = "password";
  8. $from = "";
  9. $replyto = "";
  10.  
  11. $emails = file('emails');
  12. foreach($emails as $to) {
  13.     $headers = array (
  14.                       'From' => $from,
  15.                       'To' => $to,
  16.                       'Reply-To' => $replyto,
  17.                       'Subject' => $subject
  18.                       );
  19.      $smtp = Mail::factory('smtp', array (
  20.                                           'host' => $host,
  21.                                           'auth' => true,
  22.                                           'username' => $username,
  23.                                           'password' => $password)
  24.                                           );
  25.  
  26.     $mail = $smtp->send($to, $headers, $body);
  27. }
  28.  
  29. ?>
Add Comment
Please, Sign In to add comment