Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require("class.phpmailer.php");
- require("PHPMailerAutoload.php");
- $mail = new PHPMailer();
- // VARIABLES
- $name = $_POST["name"];
- $email = $_POST["mail"];
- $message = $_POST["message"];
- $emailTo = "correo@gmail.com";
- $subject = $_POST["subject"];
- //SMTP
- //$mail->IsSMTP();
- $mail->Host = "smtp.gmail.com";
- $mail->Username = 'correo@gmail.com';
- $mail->Password = 'xxxxxx*';
- $mail->SMTPAuth = true;
- $mail->SMTPSecure = "ssl";
- $mail->Port = 465;
- // ENCABEZADO
- $mail->setFrom($email, $name);
- $mail->addAddress($emailTo, $name);
- $mail->Subject = $subject;
- // MENSAJE
- $mail->Body = $message;
- // ENVIAR MENSAJE
- if ($mail->send()) {
- echo "<script type='text/javascript'>
- alert('Enviado Correctamente');
- </script>";
- } else {
- echo "<script type='text/javascript'>
- alert('No enviado, intentar de nuevo');
- </script>";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement