Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if($_POST["mandarCorreo_hdn"]==1){
- //incluyo la clase phpmailer
- include_once("class.phpmailer.php");
- include_once("class.smtp.php");
- //Creo un objeto de tipo PHPMailer junto con sus atributos
- $mail = new PHPMailer();
- $mail->From = "jonmircha@gmail.com";
- $mail->FromName = $_POST["nombre_txt"];
- $mail->Subject = "Mensaje de contacto desde la página de ReduitManesco";
- $mail->Body="
- <html>
- <head>
- <title>Contacto Reduit Manesco</title>
- </head>
- <body>
- <h3>Datos de una persona que contacta desde la página de Reduit Manesco</h3>
- <p>
- Nombre: <b>".$_POST["nombre_txt"]."</b><br />
- Telefono: <b>".$_POST["telefono_txt"]."</b><br />
- Correo: <b>".$_POST["email_txt"]."</b><br />
- Ciudad: <b>".$_POST["ciudad_txt"]."</b><br />
- Asunto: <b>".$_POST["asunto_txt"]."</b><br />
- Comentario:<b>".$_POST["comentario_txa"]."</b>
- </p>
- </body>
- </html>
- ";
- $mail->IsHTML(true);
- $mail->IsSMTP();
- $mail->Host = "ssl://smtp.gmail.com";
- $mail->SMTPAuth = true;
- $mail->Port = 465;
- $mail->AddAddress("jonmircha@gmail.com");
- $mail->Username = "cuenta@gmail.com";
- $mail->Password = "********";
- if($mail->Send()){
- $mensaje="<div class='mensajeForm'>Tu mensaje ha sido enviado, a la brevedad nos pondrémos en contacto contigo.</div>";
- }
- }
- ?>
- <!DOCTYPE HTML>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>Formulario de Contacto</title>
- <link rel="stylesheet" type="text/css" href="../css/estilos.css" />
- <script src="../js/validaForm.js"></script>
- <style type="text/css">
- body{
- background:url(../img/formulario_bg.jpg) no-repeat;
- margin:0;
- padding:0px;
- color:#7FA900;
- }
- </style>
- </head>
- <body>
- <form id="formContacto" name="contacto_frm" action="formulario.php" method="post" enctype="application/x-www-form-urlencoded">
- Nombre: <input type="text" name="nombre_txt" /><br /><br />
- Teléfono: <input type="text" name="telefono_txt" /><br /><br />
- Correo: <input type="text" name="email_txt" /><br /><br />
- Ciudad: <input type="text" name="ciudad_txt" /><br /><br />
- Asunto: <input type="text" name="asunto_txt" /><br /><br />
- Comentarios:<br /><textarea name="comentario_txa" cols="30" rows="5"></textarea><br /><br />
- <input type="hidden" name="mandarCorreo_hdn" value="1" />
- <input type="button" name="enviar_btn" value="Enviar" onclick="validaDatos();" />
- </form>
- <?php if(isset($mensaje)){ echo $mensaje; } ?>
- </body>
- </html>
Add Comment
Please, Sign In to add comment