Código PHP:
<?php
$nombre=$_POST["nombre"];
$mail=$_POST["mail"];
$comentario=$_POST["comentario"];
//para el envío en formato HTML
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
//dirección del remitente
$headers .= "From: xxxxxx<[email protected]>\r\n";
//direcciones que recibián copia
$headers .= "Cc: [email protected]\r\n";
//direcciones que recibirán copia oculta
$headers .= "Bcc: [email protected],[email protected]\r\n";
$mensaje='
<div>
<p><strong>Nombre</strong></p>
<p>'.$nombre.'</p>
<p><strong>E-Mail</strong></p>
<p>'.$mail.'</p>
<p><strong>Comentario</strong></p>
<p>'.$comentario.'</p>
<p></p>
</div>';
echo 'Bienvenido<h2>'.$nombre.'</h2><br>';
//echo $_POST["nombre"];
mail("[email protected]","Prueba de mail",$mensaje,$headers);
header("Location:index.html");
?>
Código HTML:
<table width="100%" border="0"> <tr> <td><form id="form1" name="form1" method="post" action="contacto.php"> <p> <label>Nombre<br /> <input type="text" name="nombre" id="nombre" /> </label> </p> <p> <label>E-Mail <br /> <input type="text" name="mail" id="mail" /> </label> </p> <p> <label> <textarea name="comentario" id="comentario" cols="45" rows="5"></textarea> </label> </p> <label> <input type="submit" name="button" id="button" value="Enviar" /> </label> <br /> </form></td> </tr> </table>
Desde ya muchas gracias. Saludos.