Guest User

Untitled

a guest
Apr 10th, 2018
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.52 KB | None | 0 0
  1. <?php
  2. if($_POST["mandarCorreo_hdn"]==1){
  3.  
  4. //incluyo la clase phpmailer
  5. include_once("class.phpmailer.php");
  6. include_once("class.smtp.php");
  7.  
  8. //Creo un objeto de tipo PHPMailer junto con sus atributos
  9. $mail = new PHPMailer();
  10. $mail->From = "jonmircha@gmail.com";
  11. $mail->FromName = $_POST["nombre_txt"];
  12. $mail->Subject = "Mensaje de contacto desde la página de ReduitManesco";
  13. $mail->Body="
  14. <html>
  15. <head>
  16. <title>Contacto Reduit Manesco</title>
  17. </head>
  18. <body>
  19. <h3>Datos de una persona que contacta desde la página de Reduit Manesco</h3>
  20. <p>
  21. Nombre: <b>".$_POST["nombre_txt"]."</b><br />
  22. Telefono: <b>".$_POST["telefono_txt"]."</b><br />
  23. Correo: <b>".$_POST["email_txt"]."</b><br />
  24. Ciudad: <b>".$_POST["ciudad_txt"]."</b><br />
  25. Asunto: <b>".$_POST["asunto_txt"]."</b><br />
  26. Comentario:<b>".$_POST["comentario_txa"]."</b>
  27. </p>
  28. </body>
  29. </html>
  30. ";
  31. $mail->IsHTML(true);
  32. $mail->IsSMTP();
  33. $mail->Host = "ssl://smtp.gmail.com";
  34. $mail->SMTPAuth = true;
  35. $mail->Port = 465;
  36. $mail->AddAddress("jonmircha@gmail.com");
  37. $mail->Username = "cuenta@gmail.com";
  38. $mail->Password = "********";
  39.  
  40. if($mail->Send()){
  41. $mensaje="<div class='mensajeForm'>Tu mensaje ha sido enviado, a la brevedad nos pondr&eacute;mos en contacto contigo.</div>";
  42. }
  43. }
  44. ?>
  45. <!DOCTYPE HTML>
  46. <html>
  47. <head>
  48. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  49. <title>Formulario de Contacto</title>
  50. <link rel="stylesheet" type="text/css" href="../css/estilos.css" />
  51. <script src="../js/validaForm.js"></script>
  52. <style type="text/css">
  53. body{
  54. background:url(../img/formulario_bg.jpg) no-repeat;
  55. margin:0;
  56. padding:0px;
  57. color:#7FA900;
  58. }
  59. </style>
  60. </head>
  61.  
  62. <body>
  63. <form id="formContacto" name="contacto_frm" action="formulario.php" method="post" enctype="application/x-www-form-urlencoded">
  64. Nombre: <input type="text" name="nombre_txt" /><br /><br />
  65. Tel&eacute;fono: <input type="text" name="telefono_txt" /><br /><br />
  66. Correo: <input type="text" name="email_txt" /><br /><br />
  67. Ciudad: <input type="text" name="ciudad_txt" /><br /><br />
  68. Asunto: <input type="text" name="asunto_txt" /><br /><br />
  69. Comentarios:<br /><textarea name="comentario_txa" cols="30" rows="5"></textarea><br /><br />
  70. <input type="hidden" name="mandarCorreo_hdn" value="1" />
  71. <input type="button" name="enviar_btn" value="Enviar" onclick="validaDatos();" />
  72. </form>
  73. <?php if(isset($mensaje)){ echo $mensaje; } ?>
  74. </body>
  75. </html>
Add Comment
Please, Sign In to add comment