Ver Mensaje Individual
  #1 (permalink)  
Antiguo 02/01/2013, 19:28
horazyo
 
Fecha de Ingreso: enero-2013
Mensajes: 3
Antigüedad: 11 años, 4 meses
Puntos: 0
Exclamación formulario de contacto

hola al foro en general
este es mi primer post, que empieza con una duda relacionada al formulario de contacto de mi cliente.
El cual al intentar enviarlo me dice que no es posible enviar el formulario. anexo código de contacto y envío.

CONTACTO.PHP
<?


if(isset($_GET['a'])){
echo"<br/><P style='font-size:16px; font-family:arial;'><b>Muchas gracias</b> por ponerte en contacto con nosotros. En breve estarás recibiendo respuesta a tu solicitud vía correo electrónico o telefónica.</P>";
echo"<div align='right' style='font-size:16px; font-family:arial;'><p>El equipo de Materfilius</p></div>";
}
else{
echo"<form method='post' action='contacto_exec.php' onsubmit='return validateForm2(this)' >
<table style='font-size: 13px;' cellpadding='5' border='0' class='textos'width='153'>

<tr>
<td class='fila'>Nombre </td>
<td width='145'><input class='txb' type='text' name='nombre' class='Estilo11' size='30' maxlength='30'></td>
</tr>

<tr>
<td class='fila'>Teléfono</td>
<td width='145'><input class='txb' type='text' name='telefono' class='Estilo11' size='30' maxlength='30'></td>
</tr>
<tr>
<td class='fila'>Correo Electrónico</td>
<td width='145'><input class='txb' type='text' name='email' class='Estilo11' size='30' maxlength='30'></td>
</tr>

<tr>
<td class='fila' valign='top'>Comentario</td>
<td width='145'><textarea class='txb' type='text' name='cometarios' cols='25' rows='4' class='Estilo11'>
</textarea>

</td>
</tr>
<tr>
<td align='right' colspan='2'>
<input type='submit' value='Enviar'>
</td>

</tr>
</table>
</form>";
}
?>

CONTACTO_EXEC.PHP
<?php
foreach ($_POST as $key => $value)
{
$_POST[$key]=trim($value);
$_POST[$key]=htmlentities($value,ENT_QUOTES);
}



//$email_admin="[email protected]";

$subject_contacto="Confirmacion de Solicitud de Informacion desde Materfilius";
$subject="CONTACTO MATER FILIUS";
$mensaje_contacto="
<html>
<body>
<P>Muchas gracias por ponerte en contacto con nosotros. En breve estarás recibiendo respuesta a tu solicitud vía correo electrónico o telefónica.</P>

<P>Estamos a tus órdenes,</P>

<P>Mater Filius</P>
</body>
</html>
";

// Enviamos el mail al admin
$mensaje.="\n<html><head><title></title></head><body><table border='1' cellpadding='3' cellspacing='3'>";
while( list ($variable, $valor) = each ($_POST) )
{
$mensaje.="<tr><td>$variable</td><td>$valor</td></tr>";
}
$mensaje.="</table>\n</body></html>";

if (enviar_correo("$_POST[nombre] $_POST[Apellido]",$_POST[email],$email_admin,$email_admin,"",$subject,$mensaje))
{
if (enviar_correo("Materfilius",$email_admin,"$_POST[Nombre] $_POST[Apellido]",$_POST[email],"",$subject_contacto,$mensaje_contacto))
{
header("Location:contacto.php?a=gracias");
}
else
{
echo "error en el mail al contacto";
}
}
else
{
echo "Error: no fue posible enviar el formulario, sugerimos contactarnos telefónicamente mientras resolvemos el inconveniente";
}


function enviar_correo($fromname, $fromaddress, $toname, $toaddress, $toccaddress, $subject, $message)
{
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\n";
$headers .= "X-Priority: 3\n";
$headers .= "X-Mailer: php\n";
$headers .= "From: \"".$fromname."\" <".$fromaddress.">\n";
//$headers .= "Cc: ".$tocccaddress."\n";
//mail($toccaddress, $subject, $message, $headers);
return mail($toaddress, $subject, $message, $headers);

}

?>

Ojalá me puedan ayudar a solucionar este pequeño bug