Código HTML:
<head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Schola Veritatis - Contáctenos</title> <style type="text/css"> <!-- body,td,th { font-family: Calibri; color: #000066; } body { background-image: url(../imagenes/Fondo.jpg); } .Estilo1 { font-family: LINOTEXT; font-weight: bold; font-size: 20px; } --> </style> </head> <body> <div align="center"><img src="../SV2deftif.png" width="120" height="140" alt="Logo" /></div> <p align="justify"> Por favor escribe tu nombre, correo electrónico y te responderemos a la brevedad. <form id="Formulario" name="Formulario" method="POST" action="enviar.php"> <label>Nombre <input name="Nombre" type="text" id="Nombre" size="58" /></label><p> <label>E-Mail <input name="E-mail" type="text" id="E-mail" size="60" /></label> </p> <label>Mensaje<p><textarea name="Mensaje" cols="45" rows="8" id="Mensaje"></textarea> </label></p> <p align="center"><input type="submit" name="Botón" id="Botón" value="Enviar"/> </p> </form> <p align="center" class="Estilo1 ">Para que en todo sea Dios glorificado</p> </body> </html>
Código PHP:
<?php
$nombre = $_POST['Nombre'];
$mail = $_POST['E-mail'];
$header = 'From: ' . $mail . " \r\n";
$header .= "X-Mailer: PHP/" . phpversion() . " \r\n";
$header .= "Mime-Version: 1.0 \r\n";
$header .= "Content-Type: text/plain";
$mensaje = "Este mensaje fue enviado por " . $nombre . ", \r\n";
$mensaje .= "Su e-mail es: " . $mail . " \r\n";
$mensaje .= "Mensaje: " . $_POST['Mensaje'] . " \r\n";
$mensaje .= "Enviado el " . date('d/m/Y', time());
$para = '[email protected]';
$asunto = 'Contacto desde la página Web, de $nombre';
mail($para, $asunto, utf8_decode($mensaje), $header);
echo ''
?>
<html>
<head>
<title>mensaje enviado</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><style type="text/css">
<!--
body {
background-image: url(../imagenes/Fondo.jpg);
}
body,td,th {
font-family: Calibri;
color: #000066;
}
a:link {
color: #003399;
text-decoration: underline;
}
a:visited {
text-decoration: underline;
color: #003366;
}
a:hover {
text-decoration: none;
color: #FF9900;
}
a:active {
text-decoration: underline;
}
-->
</style>
<body>
<div align="center"><img src="../SV2deftif.png" alt="Logo" width="100" height="120"></div>
<p>Su mensaje ha sido enviado correctamente, le contestaremos tan pronto nos sea posible</p>
<p><a href="index.htm" target="mainframe">Volver</a></p>
</body>
</head>
</html>