Advertisement
Guest User

Untitled

a guest
Apr 19th, 2017
583
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 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-mail.outlook.com';
  24. $this->SMTPAuth = true;
  25. $this->Username = "janainatutor@hotmail.com";
  26. $this->Password = "xxxxxxxxx"; // SMTP account password
  27. //$this->SetFrom('janainatutor@hotmail.com', 'Adriano sites php imoveis');
  28. $this->From = 'janainatutor@hotmail.com';
  29. $this->FromName = 'Acordo Imóvel';
  30.  
  31.  
  32. }
  33.  
  34. /**
  35. *
  36. * @param type $destinatario
  37. * @param type $assunto
  38. * @param type $msg
  39. *
  40. * envia o email
  41. */
  42. public function Enviar($destinatario,$assunto,$msg) {
  43.  
  44.  
  45.  
  46. $this->Subject = $assunto;
  47. $this->addAddress($destinatario);
  48. $this->Body = $msg;
  49.  
  50.  
  51. if(parent::send()):
  52.  
  53. parent::clearAllRecipients();
  54. else:
  55.  
  56. echo 'erro no envio' . $this->ErrorInfo ;
  57. endif;
  58.  
  59.  
  60. }
  61.  
  62.  
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement