Guest User

Untitled

a guest
Oct 24th, 2017
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. $mail = new PHPMailer();
  2. $mail->setLanguage('br');
  3. $mail->CharSet='utf-8';
  4. $mail->IsSMTP();
  5. $mail->Host = "xxx";
  6. $mail->SMTPAuth = true;
  7. $mail->Username = 'xxx';
  8. $mail->Password = 'xxx';
  9. $mail->SMTPSecure = 'tls';
  10. $mail->Port = 587;
  11. $mail->From = $email; (variável que vem do banco de dados)
  12. $mail->FromName = $fantasia; (variável que vem do banco de dados)
  13. $mail->SMTPOptions = array(
  14. 'ssl' => array(
  15. 'verify_peer' => false,
  16. 'verify_peer_name' => false,
  17. 'allow_self_signed' => true
  18. )
  19. );
  20.  
  21. for($z=0; $z<count($bcc); $z++){
  22.  
  23. if($html == '1'){
  24. $topo = recebe um código html específico;
  25. $rodape = recebe um código html específico;
  26. $texto2 = recebe um código html específico, concatenando as variáveis $topo e $rodape - newsletter que será enviada;
  27. }else{
  28. if($topo == '1'){
  29. $topo = recebe um código html específico;
  30. $rodape = recebe um código html específico;
  31. }else{
  32. $topo = recebe um código html específico;
  33. $rodape = recebe um código html específico;
  34. }
  35.  
  36. $texto2 = recebe o código html específico, concatenando $topo e $rodape - newsletter que será enviada;
  37. }
  38.  
  39. $mail->AddAddress($bcc[$z]['Email']);
  40. $mail->IsHTML(true);
  41. $mail->Subject = $tit; (variável vinda do banco)
  42. $mail->Body = $texto2;
  43. $mail->AltBody = $texto2;
  44. $enviado = $mail->Send();
  45. $mail->ClearAllRecipients();
  46. $mail->ClearAttachments();
  47.  
  48. }
Add Comment
Please, Sign In to add comment