Advertisement
Guest User

Untitled

a guest
Apr 18th, 2017
1,021
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4. * descricao EmailEnviar
  5. *
  6. * @author adrianosites.com.br
  7. */
  8. class EmailEnviar extends PHPMailer {
  9.  
  10.  
  11. /**
  12. * inicia os dados de conexao com o host
  13. *
  14. */
  15. function __construct() {
  16.  
  17. $this->isSMTP();
  18. $this->isHTML(true);
  19. $this->CharSet = 'UTF-8';
  20. $this->Port = 587;
  21. $this->SMTPDebug = 0;
  22. $this->SMTPSecure = "tls";
  23. $this->Host = 'smtp.gmail.com';
  24. $this->SMTPAuth = true;
  25. $this->Username = "janainatutor@hotmail.com";
  26. $this->Password = "xxxxxxxxxx"; // SMTP account password
  27. //$this->SetFrom('janainatutor@hotmail.com', 'Adriano sites php
  28. imoveis');
  29. $this->From = 'janainatutor@hotmail.com';
  30. $this->FromName = 'Acordo Imóvel';
  31.  
  32.  
  33. }
  34.  
  35. /**
  36. *
  37. * @param type $destinatario
  38. * @param type $assunto
  39. * @param type $msg
  40. *
  41. * envia o email
  42. */
  43. public function Enviar($destinatario,$assunto,$msg) {
  44.  
  45.  
  46.  
  47. $this->Subject = $assunto;
  48. $this->addAddress($destinatario);
  49. $this->Body = $msg;
  50.  
  51.  
  52. if(parent::send()):
  53.  
  54. parent::clearAllRecipients();
  55. else:
  56.  
  57. echo 'erro no envio' . $this->ErrorInfo ;
  58. endif;
  59.  
  60.  
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement