Ver Mensaje Individual
  #1 (permalink)  
Antiguo 11/04/2008, 23:00
sayda
 
Fecha de Ingreso: diciembre-2006
Mensajes: 7
Antigüedad: 17 años, 4 meses
Puntos: 0
Ayuda con codigo de mail

He leido por todo el foro y sigo entramprada,

tengo un enviar1.php
<body>
<div align="center">
<table width="100%" border="0" cellspacing="5" cellpadding="0">
<tr>
<td>cabecera de pagina </td>
</tr>
<tr>
<td align="center"><table border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top" width="223" height="204" style="background:url("><div style=" margin-left:5px" align="center"><img src="images/7_w2.gif" alt="" width="90" height="12" /><br />
<img src="images/ba8.jpg" border="0" /><br />
<br />
<br style="line-height:22px " />
</div></td>
<td valign="top" width="247" height="204" style="background:url("><div style="padding-top:10px" >
<div align="left">
<?php
$ip = $_POST['ip'];
$httpref = $_POST['httpref']; // NO FUNCIONA, LO DEJA EN BLANCO CUANDO LLEGA EL MAIL
$httpagent = $_POST['httpagent'];
$nombre = $_POST['nombre'];
$apellido = $_POST['apellido'];
$coreovisita = $_POST['coreovisita'];
$telefono = $_POST['telefono'];
$comentario = $_POST['comentario'];
$attn = 'Formulario de Contacto- xxxxxxx';
if (eregi('http:', $comentario)) {
die ("Esta mal escrito! ! ");
}

// Validacion email SI ESTA MAL MUESTRA MENSAJE PERO NO MUESTRA EL PIE DE PAGINA
if(!$coreovisita == "" && (!strstr($coreovisita,"@") || !strstr($coreovisita,".")))
{
echo "<h1 class=verde> Ingrese un E-mail valido</h1>\n";
$badinput = "<h1 class=verde>Su comentario no fue enviado</h1>\n";
echo $badinput;
die ("<h1 class=verde>Escriba su mail en forma correcta, regrese</h1> ");
}
// valida los campos que no esten vacios. SI ESTAN VACIOS MUESTRA MENSAJE PERO NO MUESTRA PIE DE PAGINA
if(empty($nombre) || empty($coreovisita) || empty($telefono) || empty($apellido) || empty($comentario )) {
echo "<h1 class=verde> Complete todos los campos</h1>\n";
die ("<h1 class=verde>Complete los datos si desea mandarlo</h1>");
}
$todayis = date("l, F j, Y, g:i a") ;
$subject = $attn;
$comentario = stripcslashes($comentario);
$message = " $todayis [EST] \n
Mensaje: $comentario \n
From: $nombre ($coreovisita)\n
Informacion adicional : IP = $ip \n
Navegador usado: $httpagent \n
Referido de : $httpref \n
";
$from = "From: $coreovisita\r\n";
mail("[email protected]", $subject, $message, $apellido, $telefono, $from);
?>
Gracias : <?php echo $nombre ?> <?php echo $apellido ?> <br />
<br />
<br />
<br />
</div>
</div>
<br style="line-height:20px" />
<br />
<div align="center" xxxxxx se pondra en contacto a la brevedad<br />
<br />
<a href="index.php" > Volver a Inicio></a></div></td>
<td valign="top" width="242" height="204"><div style=" margin-left:17px">
<p><direccion direccion direccion direccion direccion </strong></p>
<pdireccion direccion direccion direccion direccion </strong><br />
<br />
</p>
</div></td>
</tr>
</table></td>
</tr>
<tr>
<td>pie de pagina </td>
</tr>
</table>
</div>
</body>
</html>

y tengo pruebadecontacto1.php
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body >
<div align="center">
<table width="75%" border="0" cellspacing="5" cellpadding="0">
<tr>
<td>cabecera</td>
</tr>
<tr>
<td><table border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top" width="223" height="204" <div style=" margin-left:5px" align="center"><img src="images/7_w2.gif" alt="" width="90" height="12"><br>
<img src="images/ba8.jpg" width="183" height="149" border="0"><br>
<br><br style="line-height:22px "> </div></td>
<td valign="top" width="247" height="204" <form method="post" action="enviar1.php">
<?php
$ipi = getenv("REMOTE_ADDR");
$httprefi = getenv ("HTTP_REFERER");
$httpagenti = getenv ("HTTP_USER_AGENT");
?>
<input type="hidden" name="ip2" value="<?php echo $ipi ?>" />
<input type="hidden" name="httpref2" value="<?php echo $httprefi ?>" />
<input type="hidden" name="httpagent2" value="<?php echo $httpagenti ?>" />
<table width="100%" border="0" cellspacing="5" cellpadding="0">
<tr>
<td width="22%">Nombre</td>
<td width="78%"><input name="nombre" type="text" id="nombre" size="30" maxlength="50">
</td>
</tr>
<tr>
<td>Apellido</td>
<td><input name="apellido" type="text" id="apellido" size="30" maxlength="50"></td>
</tr>
<tr>
<td>Teléfono</td>
<td><input name="telefono" type="text" id="telefono" size="10" maxlength="8"></td>
</tr>
<tr>
<td>E-mail</td>
<td><input name="coreovisita" type="text" id="coreovisita"size="30" maxlength="50"></td>
</tr>
<tr>
<td valign="top">Mensaje</td>
<td><textarea name="comentario" cols="0" rows="0" id="comentario" ></textarea></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><input name="submit" type="submit" value="Enviar "></td>
</tr>
</table>
</form></td>
<td valign="top" width="242" height="204"><div style=" margin-left:17px ">texto texto texto texto><br>
</div></td>
</tr>
</table></td>
</tr>
<tr>
<td>pie de pagina </td>
</tr>
</table>
</div>
</body>
</html>

Alguien puede decirme * favor que esta mal, no consigo q llegue el mail y si los datos estan mal o vacios me muestra los mensajes pero no me muestra el resto de la pag., e provado todo ... Gracias (una sola vez llego el mail) pero faltaban datos, los complete y despues nunca mas llegaron