Guest User

Untitled

a guest
Dec 4th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. <?php
  2.  
  3. require_once 'PHPMailer/PHPMailerAutoload.php';
  4.  
  5.  
  6. $mail = new PHPMailer();
  7. $mail->IsSMTP();
  8. $mail->Host = 'host aqui';
  9. $mail->Port = 587;
  10. $mail->SMTPAuth = true;
  11. $mail->IsHTML(true);
  12. $mail->Username = 'emailr';
  13. $mail->Password = 'senha';
  14.  
  15. $mail->SMTPSecure = false; //Diz que nao tem tls/ssl
  16. $mail->SMTPAutoTLS = false; //Diz que nao tem tls/ssl
  17.  
  18. $mail->SMTPDebug = 2; //Mostra os bugs
  19.  
  20.  
  21. //E-mail remetente (deve ser igual ao que esta enviando)
  22. $mail->From = 'email';
  23.  
  24. //Nome do remetente
  25. $mail->FromName ='Lojas';
  26.  
  27. //Assunto da mensagem
  28. $mail->Subject = 'Texto';
  29.  
  30. //Corpo da mensagem
  31. $mail->Body = 'Ola';
  32.  
  33. //Corpo da mensagem em texto
  34. $mail->AltBody = 'Conteudo do e-mail em texto';
  35.  
  36. //Destinatario
  37. $mail->AddAddress ('exemplo@email');
  38.  
  39. if ($mail->Send()) {
  40. echo "e-mail enviado com sucesso";
  41. echo'<script> alert("Cadastro realizado com sucesso!")</script>';
  42. }else{
  43. echo "Erro no envio do e-mail" .$mail->ErrorInfo;
  44. }
  45.  
  46. ?>
Add Comment
Please, Sign In to add comment