Advertisement
Guest User

Untitled

a guest
Mar 21st, 2017
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. <?php
  2.  
  3. require 'PHPMailer_5.2.4/class.phpmailer.php';
  4. $mail = new PHPMailer(true);
  5.  
  6. //Send mail using gmail
  7.  
  8. $mail->IsSMTP(); // telling the class to use SMTP
  9. $mail->SMTPAuth = true; // enable SMTP authentication
  10. $mail->SMTPSecure = "none"; // sets the prefix to the servier
  11. $mail->Host = "a.supreme-hosting.com"; // sets GMAIL as the SMTP server
  12. $mail->Port = 27; // set the SMTP port for the GMAIL server
  13. $mail->Username = "no-reply@mtools.mx"; // GMAIL username
  14. $mail->Password = "12345"; // GMAIL password
  15.  
  16.  
  17. //Typical mail data
  18.  
  19. $mail->From = "contacto@permex.com.mx";
  20.  
  21. $mail->FromName = "PERMEX Contacto";
  22.  
  23. $mail->AddAddress("contacto@permex.com.mx","Nombre 1");
  24.  
  25. $mail->Subject = "Mensaje de Contacto ".$_POST['email'];
  26. $mail->Body = $_POST['mensaje'];
  27.  
  28. try {
  29. $mail->Send();
  30.  
  31. header( 'Location: ../html/contacto.html' ) ;
  32. } catch(Exception $e) {
  33. //Something went bad
  34. echo "Fail - " . $mail->ErrorInfo;
  35. }
  36.  
  37. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement