Advertisement
Guest User

Untitled

a guest
Aug 25th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. <?
  2. require("PHPMailer/class.phpmailer.php");
  3. $select = mysql_query("SELECT * FROM `pm_mailmembers` WHERE `mm_interval`='2' AND mm_blocked = 0") or die(mysql_error());
  4. $mail = new PHPMailer();
  5. $mail->SingleTo = true;
  6. $mail->CharSet = "UTF-8";
  7. $mail->Subject = "Fiscanet Nieuws";
  8. $sendContent = "<p>This is test mail</p>";
  9. $r_receivers = array("John"=>"john@mail.com","Mary"=>"mary@mail.com","Rob"=>"rob@mail.com");
  10. foreach($r_receivers as $name=>$email){
  11. $mail->SetFrom('no-reply@yoursite.com', "Yoursite");
  12. $mail->MsgHTML($sendContent);
  13. $mail->AddAddress($email, $name);
  14. if($mail->Send())
  15. echo "Sent to: ".$email."<br/>";
  16. else
  17. echo "Not sent to: ".$email.", reason: ".$mail->ErrorInfo."<br/>";
  18. $mail->ClearAddresses();
  19. }
  20. ?>
  21.  
  22. <?php
  23. require("PHPMailer/class.phpmailer.php");
  24. $mail = new PHPMailer();
  25. $mail->SingleTo = true;
  26. $mail->CharSet = "UTF-8";
  27. $mail->Subject = "Fiscanet Nieuws";
  28. $r_receivers = array("John"=>"john@mail.com","Mary"=>"mary@mail.com","Rob"=>"rob@mail.com");
  29. $i = 1;
  30. foreach($r_receivers as $name=>$email){
  31. $mail->SetFrom('no-reply@yoursite.com', "Yoursite");
  32. $mail->MsgHTML($sendContent);
  33. $mail->AddAddress($email, $name);
  34. $sendContent = "<p>This is test mail number ".$i." sent at ".date('H:i:s')."</p>";
  35. if($mail->Send())
  36. echo "Sent to: ".$email."<br/>";
  37. else
  38. echo "Not sent to: ".$email.", reason: ".$mail->ErrorInfo."<br/>";
  39. $mail->ClearAddresses();
  40. $i++;
  41. }
  42. ?>
  43.  
  44. $mail->ClearAllRecipients();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement