Foros del Web » Programando para Internet » PHP »

En que estoy fallando? (envio de mail)

Estas en el tema de En que estoy fallando? (envio de mail) en el foro de PHP en Foros del Web. Hola me gustaria que me digan en que estoy fallando ya que el envio de mail es perfecto pero como veran lo estoy mandando en ...
  #1 (permalink)  
Antiguo 06/12/2004, 21:43
 
Fecha de Ingreso: noviembre-2004
Mensajes: 35
Antigüedad: 19 años, 4 meses
Puntos: 1
En que estoy fallando? (envio de mail)

Hola me gustaria que me digan en que estoy fallando ya que el envio de mail es perfecto pero como veran lo estoy mandando en html y cunado me llega el mensaje no me pone los datos del formulario, no se si me expreso bien pero mi intencion es recibir un mail en formato html que tenga los datos del formulario que llenaron los usuarios.Desde ya gracias

<?
$mensaje = "";
if (isset($_POST["Enviar"])){
if(empty($_POST[Dominio])){
$mensaje .= "Debes escribir un Dominio.<br>";
}
if(empty($_POST[Estado])){
$mensaje .= "Debes escribir el estado del Dominio.<br>";
}
if(empty($_POST[Nombre])){
$mensaje .= "Debes escribir un Nombre.<br>";
}
if(empty($_POST[Apellido])){
$mensaje .= "Debes escribir un Apellido.<br>";
}
if(empty($_POST[Tipo])){
$mensaje .= "Debes escribir el tipo de Documento.<br>";
}
if(empty($_POST[Numero])){
$mensaje .= "Debes escribir el nuemro de Documento.<br>";
}
if(empty($_POST[Email])){
$mensaje .= "Debes escribir un Email.<br>";
}
if(empty($_POST[Cod])){
$mensaje .= "Debes escribir el codigo de area.<br>";
}
if(empty($_POST[Telefono])){
$mensaje .= "Debes escribir un numero de Telefono.<br>";
}
if(empty($_POST[Direccion])){
$mensaje .= "Debes escribir tu domicilio.<br>";
}
if(empty($_POST[Localidad])){
$mensaje .= "Debes escribir la Localidad.<br>";
}
if(empty($_POST[Provincia])){
$mensaje .= "Debes escribir la Provincia.<br>";
}
if(empty($_POST[Codigopostal])){
$mensaje .= "Debes escribir el Codigo Postal.<br>";
}
if(empty($_POST[Pais])){
$mensaje .= "Debes seleccionar el Pais.<br>";
}
if(empty($_POST[Servicio])){
$mensaje .= "Debes seleccionar el tipo de Servicio.<br>";
}
if(empty($_POST[Formapago])){
$mensaje .= "Debes seleccionar el plazo de pago.<br>";
}
if(empty($_POST[Origen])){
$mensaje .= "Debes seleccionar como nos conociste.<br>";
}
if(empty($_POST[acepto])){
$mensaje .= "Debes aceptar los terminos y condiciones de Servicio.<br>";
}
if ($mensaje != ""){
echo "SE HAN PRODUCIDO LOS SIGUIENTES ERRORES:<br>".$mensaje;
echo "<input TYPE=\"button\" VALUE=\" ATRÁS\" onClick=\"history.go(-1)\">";
exit;
}
}
?>
<?php
/* mensaje */
$mensaje = '
<html>
<head>
<title>Contrato de servicio</title>
</head>
<body>
<table width="600" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="226" height="73" valign="top"><div align="left"><img src="/Imagen/logo_panel.jpg" width="225" height="73"></div></td>
<td width="374" align="right" valign="middle"><BR> <p><strong><font color="#000099" size="+1">CONTRATO
DE SERVICIO</font></strong><font color="#000099">&nbsp;</font></p></td>
</tr>
<tr>
<td height="20" colspan="2" valign="top"> <hr color="#000099" width="600" size="2" noshade>
</td>
</tr>
<tr>
<td height="557" colspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="10">
<!--DWLayoutTable-->
<tr>
<td width="580" height="228" valign="top"> <p><font size="2"> <font color="#000000"><font size="3">
. $_POST["Apellido"] ["Nombre"]. "(" . $_POST["Empresa].")" <br>"\n";
. $_POST["Tipo"] ["Numero"] . <br> "\n";
. $_POST["Direccion"] . "\n";<br>
. $_POST["Codigopostal"] ["Localidad"] . "\n";<br>
. $_POST["Provincia"] ["Pais"] . "\n";<br>
<br>
"Teléfono:" . $_POST["Cod"] ["Telefono"] . "\n";<br>
"Celular:" . $_POST["Cod"] . &quot;15 - &quot; . $_POST["Celular"]
. "\n";<br>
"E-mail:" . $_POST["Email"] . "\n";<br>
"E-mail2:" . $_POST["Email2"] . "\n";</font></font></font></p>
<p><font color="#000000" size="3">***************************************** *******************************</font></p></td>
</tr>
<tr>
<td height="309" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td height="105" colspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#000000">
<!--DWLayoutTable-->
<tr>
<td width="155" height="25" valign="middle" bgcolor="#AAE3FF">&nbsp;Nombre
del Dominio:</td>
<td width="422" valign="middle" bgcolor="#FFFFFF">&nbsp;
"www.". $_POST["Dominio"] . "\n"; </td>
</tr>
<tr>
<td height="25" valign="middle" bgcolor="#AAE3FF">&nbsp;Estado
de mismo:</td>
<td valign="middle" bgcolor="#FFFFFF">&nbsp;. $_POST["Estado"]
. "\n";</td>
</tr>
<tr>
<td height="25" valign="middle" bgcolor="#AAE3FF">&nbsp;Servicio
contratado:</td>
<td valign="middle" bgcolor="#FFFFFF">&nbsp;. $_POST["Servicio"]
. "\n";</td>
</tr>
<tr>
<td height="25" valign="middle" bgcolor="#AAE3FF">&nbsp;Plazo
de pago:</td>
<td valign="middle" bgcolor="#FFFFFF">&nbsp;. $_POST["Formapago"]
. "\n";</td>
</tr>
</table></td>
</tr>
<tr>
<td width="154" height="53" align="right" valign="middle">&nbsp;.
$_POST["acepto"] . "\n";</td>
<td width="426" valign="middle">&nbsp;Declaro y acepto haber leido
los Terminos y condiciones de Servicio</td>
</tr>
<tr valign="middle">
<td height="126" colspan="2">. $_POST["Comentarios"] . "\n";</td>
</tr>
<tr valign="middle">
<td height="25" colspan="2">&nbsp;Los conoci por . $_POST["Origeno"]
. "\n";</td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
';
$to = "info@tupagina";
$subject = "Servicio de Internet contratado por: $Apellido, $Nombre";
$mailheader = "MIME-Version: 1.0 \r\n";
$mailheader .= "Content-type: text/html; charset=iso-8859-1 \r\n";
$mailheader .= "From: Apache {$_SERVER['SERVER_ADMIN']} \r\n";
$mailheader .= "Return-path: $Email \r\n";
$mailheader .= "X-Priority: 1 \r\n";
$mailheader .= "X-MSMail-Priority: High \r\n";
$mailheader .= "X-Mailer: PHP/".phpversion()." \n";
if (mail ($to,$subject,$mensaje,$mailheader))
{
header("Location:gracias.php");
exit;
} else {
header("Location:error.php");
exit;
}

?>
  #2 (permalink)  
Antiguo 07/12/2004, 04:51
Avatar de Torus  
Fecha de Ingreso: enero-2002
Ubicación: Tú buscame y me encontraras
Mensajes: 413
Antigüedad: 22 años, 3 meses
Puntos: 0
Hola jose2003:
En primer lugar decirte que tienes un "batiburrillo" de comillas <br> y \n en el codigo del mensaje, te envio lo que yo creo que deberias de hacer cambia el codigo por el que te envio y pruebalo.
En segundo lugar en los if(empty($_POST[Estado])){ creo que te faltan las comillas quedaria así:
if(empty($_POST['Estado'])){
Espero que te sea de utilidad
Un Saludo


Código PHP:
$mensaje "<table width='600' border='0' cellpadding='0' cellspacing='0'>
<!--DWLayoutTable-->
<tr> 
<td width='226' height='73' valign='top'><div align='left'><img src='/Imagen/logo_panel.jpg' width='225' height='73'></div></td>
<td width='374' align='right' valign='middle'><BR> <p><strong><font color='#000099' size='+1'>CONTRATO 
DE SERVICIO</font></strong><font color='#000099'>&nbsp;</font></p></td>
</tr>
<tr> 
<td height='20' colspan='2' valign='top'> <hr color='#000099' width='600' size='2' noshade> 
</td>
</tr>
<tr> 
<td height='557' colspan='2' valign='top'><table width='100%' border='0' cellpadding='0' cellspacing='10'>
<!--DWLayoutTable-->
<tr> 
<td width='580' height='228' valign='top'> <p><font size='2'> <font color='#000000'><font size='3'>"
$_POST['Apellido'] ['Nombre']. "(" $_POST['Empresa'].") <br> "
$_POST['Tipo'] ['Numero'] . "<br> \n"
$_POST['Direccion'] . "<br>\n"
$_POST['Codigopostal'] ['Localidad'] . "<br>\n"
$_POST['Provincia'] ['Pais'] . "\n <br> <br>
Teléfono: "
$_POST['Cod'] ['Telefono'] ." \n <br>
Celular: "
$_POST['Cod'] . "'15 - '" $_POST['Celular'] . "\n <br>
E-mail:" 
$_POST['Email'] . "\n <br>
E-mail2:" 
$_POST['Email2'] . "\n </font></font></font></p>
<p><font color='#000000' size='3'>************************************************** **********************</font></p></td>
</tr>
<tr> 
<td height='309' valign='top'><table width='100%' border='0' cellpadding='0' cellspacing='0'>
<!--DWLayoutTable-->
<tr> 
<td height='105' colspan='2' valign='top'><table width='100%' border='0' cellpadding='0' cellspacing='1' bgcolor='#000000'>
<!--DWLayoutTable-->
<tr> 
<td width='155' height='25' valign='middle' bgcolor='#AAE3FF'>&nbsp;Nombre 
del Dominio:</td>
<td width='422' valign='middle' bgcolor='#FFFFFF'>&nbsp; 
www."
$_POST['Dominio'] . "\n </td>
</tr>
<tr> 
<td height='25' valign='middle' bgcolor='#AAE3FF'>&nbsp;Estado 
de mismo:</td>
<td valign='middle' bgcolor='#FFFFFF'>"
$_POST['Estado'
"\n </td>
</tr>
<tr> 
<td height='25' valign='middle' bgcolor='#AAE3FF'>&nbsp;Servicio 
contratado:</td>
<td valign='middle' bgcolor='#FFFFFF'>"
$_POST['Servicio'
"\n </td>
</tr>
<tr> 
<td height='25' valign='middle' bgcolor='#AAE3FF'>&nbsp;Plazo 
de pago:</td>
<td valign='middle' bgcolor='#FFFFFF'>"
$_POST['Formapago'
"\n </td>
</tr>
</table></td>
</tr>
<tr> 
<td width='154' height='53' align='right' valign='middle'>"

$_POST['acepto'] . "\n </td>
<td width='426' valign='middle'>&nbsp;Declaro y acepto haber leido 
los Terminos y condiciones de Servicio</td>
</tr>
<tr valign='middle'> 
<td height='126' colspan='2'>"
$_POST['Comentarios'] . "\n </td>
</tr>
<tr valign='middle'> 
<td height='25' colspan='2'>&nbsp;Los conoci por "
$_POST['Origeno'
"\n </td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>"

__________________
Hay tanto que aprender y tan poco tiempo
  #3 (permalink)  
Antiguo 09/12/2004, 06:42
 
Fecha de Ingreso: noviembre-2004
Mensajes: 35
Antigüedad: 19 años, 4 meses
Puntos: 1
lo voy a probar

Gracias Torus lo voy a probar hoy y despues te cuento, desde ya muchas gracias pero me volvi loco tratando de ver la falla.
  #4 (permalink)  
Antiguo 09/12/2004, 06:49
 
Fecha de Ingreso: noviembre-2004
Mensajes: 35
Antigüedad: 19 años, 4 meses
Puntos: 1
Funciona

Hola Torus me funciona !!!! voy a tener que aprender mucha mas. Gracias por tu ayuda.
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 01:03.