Guest User

Untitled

a guest
Jun 18th, 2018
925
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. $Email = new PHPMailer;
  2. $Email->IsSMTP();
  3. $Email->Host = "mail.cliqueipet.com.br";
  4. $Email->SMTPAuth = false;
  5. $Email->IsHTML(true);
  6. $Email->Username = "xxxx";
  7. $Email->Password = "xxxx";
  8. $Email->SMTPSecure = "tls";
  9. //$Email->SMTPDebug = 2;
  10. $Email->From = "convites@xxx.com.br";
  11.  
  12.  
  13. $Email->CharSet = "UTF-8";
  14. $Email->FromName = $Nome . " - Festa na Vila das Pitangas";
  15. //here is i am adding address
  16. for($i=0; $i<count($email); $i++):
  17. $Email->AddAddress($email[$i]);
  18. endfor;
  19. $Email->Port = 587;
  20. $Email->Subject = " Convite para festa de $Nome na Vila das Pitangas. ";
  21.  
  22. for($i=0; $i<count($email); $i++):
  23. $mail->addAddress($email[$i]);
  24. $mail->Subject = 'Convite para festa de $Nome na Vila das Pitangas.';
  25. $mail->Body = '<your mail body here>';
  26. if(!$mail->send()) {
  27. echo 'Message was not sent.';
  28. echo 'Mailer error: ' . $mail->ErrorInfo;
  29. } else {
  30. echo 'Message has been sent.';
  31. }
  32. endfor; //this should end when ur first email sent
  33.  
  34. $bcc_emails = "info@live.com;other@hotmail.com";
  35.  
  36. $bcc_emails_array = explode(";", $bcc_emails);
  37. foreach($bcc_emails_array as $email)
  38. {
  39. $mail->addBCC($email);
  40. }
Add Comment
Please, Sign In to add comment