Guest User

Untitled

a guest
Dec 2nd, 2017
383
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. <?php
  2.  
  3. include 'conexionbd.php';
  4. include 'PHPMailer/src/PHPMailer.php';
  5.  
  6. $oMail = new PHPMailer();
  7.  
  8. $oMail->isSMTP();
  9. $oMail->Host = 'smtp.mailtrap.io';
  10. $oMail->Username = ' 45d7f968676e1e';
  11. $oMail->Password = '166b3920081adc';
  12.  
  13. $oMail->SMTPAuth = true;
  14. $oMail->SMTPSecure = 'tls';
  15. $oMail->Port = 25;
  16.  
  17. //Datos
  18.  
  19. $name = $_POST['name'];
  20. $oMail->From = $_POST['email']; //remitente
  21. $oMail->addAddress('gpojava@gmail.com');
  22. $oMail->Subject = 'HOLA JAVAEVENTOS SOY';
  23. $mail->Body = $_POST['mensaje'];
  24.  
  25. $oMail->send();
  26.  
  27. if($oMail->send() == false){
  28. header('Location:socios.php');
  29. echo $oMail->ErrorInfo();
  30. }else{
  31. header('Location:index.php');
  32. }
Add Comment
Please, Sign In to add comment