Advertisement
Guest User

Untitled

a guest
Apr 4th, 2017
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. {<?php
  2. require('PHPMailer/PHPMailerAutoload.php');
  3.  
  4. $oMail = new PHPMailer();
  5.  
  6. $oMail->isSMTP();
  7. $oMail->Host = 'mailtrap.io';
  8. $oMail->Username = '******@gmail.com'; //Oculto por privacidad
  9. $oMail->Password = '****************'; //Oculto por privacidad
  10.  
  11. /***/
  12. $oMail->SMTPAuth = true;
  13. $oMail->SMTPSecure = 'tls';
  14. $oMail->Port = 25 ;
  15. $oMail->CharSet = "UTF-8";
  16.  
  17. /* Envio de mensaje */
  18. $oMail->From = 'mail@sitioweb.com';
  19. $oMail->addAddress($_POST['email']);
  20.  
  21. $oMail->Subject = $_POST['asunto'];
  22. $oMail->Body = $_POST['mensaje'];
  23.  
  24. /***/
  25. if($oMail->send() == false){
  26. echo "No se pudo enviar email";
  27. echo $oMail->ErrorInfo;
  28. } else {
  29. echo "Mensaje enviado";
  30. }
  31.  
  32. ?>}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement