aqui dejo el codigo:
este es archivo <contacto.html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#enviar").click(function(){
var identificacion=$('#identificacion').attr('value');
alert(identificacion);
$.ajax({
type: "POST",
url: "paginas/envia.php",
data:'identificacion='+ identificacion,
success: function(datos){
alert("mensaje enviado");
$("#contenido").load('paginas/contacto.html');
}
});
return false;
});
});
</script>
<title>Documento sin título</title>
</head>
<body>
<br/>
<br/>
<p>
Datos del Remitente</p>
<br/>
<form name="frmcontacto" method="post">
<table width="302" border="0">
<tr>
<td width="129"> Identificación * </td>
<td width="157"><input type="text" id="identificacion" name="identificacion" size="25"/></td>
</tr>
<tr>
<td> Nombres * </td>
<td><input type="text" name="nombre" size="25"/></td>
</tr>
<tr>
<td> Correo Electrónico * </td>
<td><input type="text" name="email" size="25"/></td>
</tr>
<tr>
<td> Tipo</td>
<td><select name="tipo"><option value"quejas y reclamos ">Quejas y Reclamos </option>
<option value"saludo">Saludo</option>
<option value"sugerencias">Sugerencias</option>
<option value"sin asunto">Sin asunto</option>
</select>
</td>
</tr>
</table>
<p>Contenido</p>
<textarea id="mensaje" name="contenido" rows="10" cols="40"></textarea><br/><br/>
<input type="submit" name="enviar" id="enviar" value="Enviar"/>
</form>
</body>
</html>
//-------------------------------------------------------------------------------------------------------
Este es el <envia.php>:
<?php
$to="[email protected]";
$ide=$_POST['identificacion'];
$nombre=$_POST['nombre'];
$correo=$_POST['email'];
$subject=$_POST['tipo'];
$message=$_POST['contenido'];
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1 \r\n";
$headers .= "From: $_POST[nombre] <$_POST[email]> \r\n";
$headers .= "Reply-To: " . $_POST['email'];
$fd = popen("/usr/sbin/sendmail -t", 'w');
fputs($fd, "To: $to\n");
fputs($fd, "Subject: $subject\n");
fputs($fd, "X-Mailer: PHP4\n");
if ($headers) {
fputs($fd, "$headers\n");
}
fputs($fd, "\n");
fputs($fd, $message);
pclose($fd);
echo "Mensaje enviado, Gracias por sus sugerencias";*/
?>
