Guest User

Untitled

a guest
Aug 3rd, 2018
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. PHPMailer 5.1 sends duplicatie mails when adding more than 1 receiver
  2. $mail = new PHPMailer();
  3. $mail->AddReplyTo("name@yourdomain.com","First Last");
  4. $mail->SetFrom('name@yourdomain.com', 'First Last');
  5.  
  6. $mail->AddAddress("info@address.com");
  7. $mail->AddAddress("info@address.nl");
  8. $mail->Subject = "PHPMailer Test Subject via mail(), basic";
  9.  
  10. $mail->Send();
  11.  
  12. $mail = new PHPMailer();
  13.  
  14. $mail->SingleTo = true; //will send mail to each email address individually
  15.  
  16.  
  17. $mail->AddReplyTo("name@yourdomain.com","First Last");
  18. $mail->SetFrom('name@yourdomain.com', 'First Last');
  19.  
  20. $mail->AddAddress("info@address.com");
  21. $mail->AddAddress("info@address.nl");
  22. $mail->Subject = "PHPMailer Test Subject via mail(), basic";
  23.  
  24. $mail->Send();
Add Comment
Please, Sign In to add comment