
el de html
<form action="mail.php" method="post" name="contacts-form" id="contacts-form">
<fieldset>
<div class="field">
<label>Tu nombre:</label>
<input name="nombre" type="text" id="nombre" value="" maxlength="50"/>
</div>
<div class="field">
<label>Tu e-mail:</label>
<input name="ddonde" type="text" id="ddonde" value="" maxlength="50"/>
</div>
<div class="field">
<label>Asunto:</label>
<input name="asunto" type="text" id="asunto" value="" maxlength="50"/>
</div>
<div class="field">
<label>Mensaje:</label>
<textarea name="razon" id="razon" cols="1" rows="1"></textarea>
</div>
<div class="wrapper"><a href="mail.php" class="link1" onClick="document.getElementById('contacts-form').submit()"><em><b>Envía tu mensaje!<span>Envía tu mensaje!</span></b></em></a></div>
</fieldset>
</form>
////////////////////php
<?
if (isset($_POST['action'])) {
$dest = "[email protected]";
$head = "From: ".$_POST['ddonde']."\r\n";
$head.= "To:[email protected]\r\n";
// Ahora creamos el cuerpo del mensaje
$msg = "------------------------------- \n";
$msg.= " Comentarios \n";
$msg.= "------------------------------- \n";
$msg.= "NOMBRE: ".$_POST['nombre']."\n";
$msg.= "EMAIL: ".$_POST['ddonde']."\n";
$msg.= "Asunto: ".$_POST['aasunto']."\n";
$msg.= "HORA: ".date("h:i:s a ")."\n";
$msg.= "FECHA: ".date("D, d M Y")."\n";
$msg.= "IP: ".$REMOTE_ADDR."\n";
$msg.= "------------------------------- \n\n";
$msg.= $_POST['razon']."\n\n";
$msg.= "------------------------------- \n";
$msg.= " Mensaje creado por conexionpc.com \n";
// Finalmente enviamos el mensaje
if (mail($dest, "Comentarios", $msg, $head)) {
$aviso = "Gracias por comunicarse con nosotros.";
} else {
$aviso = "Error de envío.";
}
};
?>