Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require 'PHPMailer_5.2.4/class.phpmailer.php';
- $mail = new PHPMailer(true);
- //Send mail using gmail
- $mail->IsSMTP(); // telling the class to use SMTP
- $mail->SMTPAuth = true; // enable SMTP authentication
- $mail->SMTPSecure = "none"; // sets the prefix to the servier
- $mail->Host = "a.supreme-hosting.com"; // sets GMAIL as the SMTP server
- $mail->Port = 27; // set the SMTP port for the GMAIL server
- $mail->Username = "no-reply@mtools.mx"; // GMAIL username
- $mail->Password = "12345"; // GMAIL password
- //Typical mail data
- $mail->From = "contacto@permex.com.mx";
- $mail->FromName = "PERMEX Contacto";
- $mail->AddAddress("contacto@permex.com.mx","Nombre 1");
- $mail->Subject = "Mensaje de Contacto ".$_POST['email'];
- $mail->Body = $_POST['mensaje'];
- try {
- $mail->Send();
- header( 'Location: ../html/contacto.html' ) ;
- } catch(Exception $e) {
- //Something went bad
- echo "Fail - " . $mail->ErrorInfo;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement