Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {<?php
- require('PHPMailer/PHPMailerAutoload.php');
- $oMail = new PHPMailer();
- $oMail->isSMTP();
- $oMail->Host = 'mailtrap.io';
- $oMail->Username = '******@gmail.com'; //Oculto por privacidad
- $oMail->Password = '****************'; //Oculto por privacidad
- /***/
- $oMail->SMTPAuth = true;
- $oMail->SMTPSecure = 'tls';
- $oMail->Port = 25 ;
- $oMail->CharSet = "UTF-8";
- /* Envio de mensaje */
- $oMail->From = 'mail@sitioweb.com';
- $oMail->addAddress($_POST['email']);
- $oMail->Subject = $_POST['asunto'];
- $oMail->Body = $_POST['mensaje'];
- /***/
- if($oMail->send() == false){
- echo "No se pudo enviar email";
- echo $oMail->ErrorInfo;
- } else {
- echo "Mensaje enviado";
- }
- ?>}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement