Advertisement
Guest User

Untitled

a guest
Jun 8th, 2016
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. stan.smith@americandadcia.fx, Stan Smith
  2.  
  3. function SendEmail($to,$fromName, $subject, $message)
  4. {
  5. date_default_timezone_set('Etc/UTC');
  6.  
  7. $mail = new PHPMailer;
  8. $mail->isSMTP();
  9. $mail->SMTPDebug = 2;
  10. $mail->Debugoutput = 'html';
  11. $mail->Host = smtp_host;
  12. $mail->Port = smtp_port;
  13. $mail->SMTPSecure = smtp_protocol;
  14. $mail->SMTPAuth = true;
  15. $mail->Username = smtp_user;
  16. $mail->Password = smtp_pass;
  17. $mail->setFrom(smtp_user, $fromName);
  18. $mail->addReplyTo(smtp_user, $fromName);
  19. $mail->addAddress($to);
  20. $mail->Subject = $subject;
  21. $mail->msgHTML($message);
  22. $mail->send();
  23. if (!$mail->send()) {
  24. echo "Mailer Error: " . $mail->ErrorInfo;
  25. }
  26.  
  27.  
  28. }
  29.  
  30. stan.smith@americandad.fx, Stan Smith; roger.smith@amongyou.ufo, Roger Smith; francine.smith@desperatehousewives.fox, Francine Smith
  31.  
  32. $mail = new MailSystem();
  33. $emails=$_POST['emailTo'];
  34. $email=explode(";",$emails);
  35. foreach($email as $address) {
  36. echo $mail->SendEmail($address, SITE_NAME." Newsletter", $_POST['emailSubject'], $_POST['emailBody']);
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement