Foros del Web » Programando para Internet » PHP »

envio de email

Estas en el tema de envio de email en el foro de PHP en Foros del Web. Hola: quiero enviar un email con un determinado contenido. lo hago de esta manera. el problema es que cuando recibo el email el contenido me ...
  #1 (permalink)  
Antiguo 04/07/2007, 02:27
 
Fecha de Ingreso: enero-2002
Mensajes: 838
Antigüedad: 22 años, 3 meses
Puntos: 1
envio de email

Hola:

quiero enviar un email con un determinado contenido.

lo hago de esta manera. el problema es que cuando recibo el email el contenido me aparece en codigo(<table>.-....)

este es el codigo:

Código PHP:
$me_lo_envio="[email protected]";
//Asunto
$asunto="Nuevo miembro";
//Enviamos el mail
mail($me_lo_envio,$asunto"
<table width=399 border=0 cellspacing=0 cellpadding=0>
        <tr> 
          <td width=399 height=19 bgcolor=#EDE4E4><font color=#990000>Datos 
            personales</font></td>
        </tr>
        <tr> 
          <td height=60 valign=top> <table width=379 border=0 cellspacing=0 cellpadding=0>
              <tr> 
                <td width=57 height=18><font color=#990000>Nombre</font></td>
                <td width=111 height=18><font color=#990000>$nombre_usuario2</font></td>
                <td width=110 height=18><font color=#990000>&nbsp;</font></td>
                <td width=101 height=18><font color=#990000>&nbsp;</font></td>
              </tr>
              <tr> 
                <td height=18><font color=#990000>Apellido1</font></td>
                <td height=18><font color=#990000>$apellido12</font></td>
                <td height=18><font color=#990000>Apellido2</font></td>
                <td height=18><font color=#990000>$apellido22</font></td>
              </tr>
              <tr> 
                <td height=18><font color=#990000>Tel&eacute;fono</font></td>
                <td height=18> <font color=#990000>$telefono2</font></td>
                <td height=18><font color=#990000>Fecha de nacimiento</font></td>
                <td height=18><font color=#990000>$fecha_nacimiento2</font></td>
              </tr>
            </table>"
);
    if (
mail!=TRUE)
    {
echo 
"error";
    } 
Gracias, un saludo
__________________
Muchas gracias, saludos.
  #2 (permalink)  
Antiguo 04/07/2007, 03:50
 
Fecha de Ingreso: enero-2002
Mensajes: 838
Antigüedad: 22 años, 3 meses
Puntos: 1
Re: envio de email

ya lo solucione añadiendo:

$headers = "MIME-Version: 1.0 \n";
$headers .= "Content-type: text/html; charset=iso-8859-1 \n";

pero como puedo añadir ahora un estilo??

gracias, un saludo
__________________
Muchas gracias, saludos.
  #3 (permalink)  
Antiguo 04/07/2007, 04:14
 
Fecha de Ingreso: enero-2002
Mensajes: 838
Antigüedad: 22 años, 3 meses
Puntos: 1
Re: envio de email

ya solucione lo del style.

pero ahora tengo otro problema.

los valores de php me aparecen vacios, porque puede ser?? necesitaría añadir alguna cosa mas??

gracias, un saludo.

aqui os dejo el codigo que utilizo.
nota: si lo envio tal cual($usuario...)sin etiquetas html si llega el valor, gracias

$to="[email protected]";
//Asunto
$subject="Nuevo miembro";
//Enviamos el mail
$message = '
<table width="408" height="208" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="56"> <table width="399" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="399" height="19" bgcolor="#EDE4E4"><font color="#990000" style="font-family: Tahoma, Verdana; font-size: 11px">Datos
personales</font></td>
</tr>
<tr>
<td height="60" valign="top"> <table width="379" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="57" height="18"><font color="#990000" style="font-family: Tahoma, Verdana; font-size: 11px">Nombre</font></td>
<td width="111" height="18"><font color="#990000" style="font-family: Tahoma, Verdana; font-size: 11px">$nombre_usuario2</font></td>
<td width="110" height="18"><font color="#990000" style="font-family: Tahoma, Verdana; font-size: 11px">&nbsp;</font></td>
<td width="101" height="18"><font color="#990000" style="font-family: Tahoma, Verdana; font-size: 11px">&nbsp;</font></td>
</tr>
<tr>
<td height="18"><font color="#990000" style="font-family: Tahoma, Verdana; font-size: 11px">Apellido1</font></td>
<td height="18"><font color="#990000" style="font-family: Tahoma, Verdana; font-size: 11px"><?php echo $apellido12; ?></font></td>
<td height="18"><font color="#990000" style="font-family: Tahoma, Verdana; font-size: 11px">Apellido2</font></td>
<td height="18"><font color="#990000" style="font-family: Tahoma, Verdana; font-size: 11px"><?php echo $apellido22; ?></font></td>
</tr>
<tr>
<td height="18"><font color="#990000" style="font-family: Tahoma, Verdana; font-size: 11px">Tel&eacute;fono</font></td>
<td height="18"> <font color="#990000" style="font-family: Tahoma, Verdana; font-size: 11px"><?php echo $telefono2; ?></font></td>
<td height="18"><font color="#990000" style="font-family: Tahoma, Verdana; font-size: 11px">Fecha
de nacimiento</font></td>
<td height="18"><font color="#990000" style="font-family: Tahoma, Verdana; font-size: 11px"><?php echo $fecha_nacimiento2; ?></font></td>
</tr>
</table>
';
$headers = "MIME-Version: 1.0 \n";
$headers .= "Content-type: text/html; charset=iso-8859-1 \n";

mail($to, $subject, $message, $headers);
__________________
Muchas gracias, saludos.
  #4 (permalink)  
Antiguo 04/07/2007, 05:32
Avatar de rimobi  
Fecha de Ingreso: julio-2007
Mensajes: 84
Antigüedad: 16 años, 9 meses
Puntos: 1
Re: envio de email

YO UTILIZO ESTE CODIGO Y SI QUIERE CAMBIAR EL DESTINATARIO PONGA UN VARIABLE EN SU LUGAR Y PONGA UN CUADRO PARA EL DESTINATARIO...

<html>
<head>
<title>Mándanos tus comentarios</title>
</head>

<body bgcolor="#cccc66" text="#003300" link="#006060" vlink="#006060">
<?
if (!$HTTP_POST_VARS){
?>
<form action="Formulario.php" method=post>
Nombre: <input type=text name="nombre" size=16>
<br>
Email: <input type=text name=email size=16>
<br>
Comentarios: <textarea name=coment cols=32 rows=6></textarea>
<br>
<input type=submit value="Enviar">
</form>
<?
}else{
//Estoy recibiendo el formulario, compongo el cuerpo
$cuerpo = "Formulario enviado\n";
$cuerpo .= "Nombre: " . $HTTP_POST_VARS["nombre"] . "\n";
$cuerpo .= "Email: " . $HTTP_POST_VARS["email"] . "\n";
$cuerpo .= "Comentarios: " . $HTTP_POST_VARS["coment"] . "\n";

//mando el correo...
mail("[email protected]","Formulario recibido",$cuerpo);

//doy las gracias por el envío
echo "Gracias por rellenar el formulario. Se ha enviado correctamente.";
}
?>
</body>
</html>
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 06:59.