Ver Mensaje Individual
  #7 (permalink)  
Antiguo 03/08/2008, 06:10
Avatar de DooBie
DooBie
 
Fecha de Ingreso: septiembre-2004
Mensajes: 1.101
Antigüedad: 19 años, 7 meses
Puntos: 71
Respuesta: enviar noticias por e-mail

Cita:
Iniciado por moquehua Ver Mensaje
agrego el código completo de recomendar.php donde el while solo imprime un resultado
Código PHP:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Recomendar</title>
<style type="text/css">
<!--
body {
    margin-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
}
-->
</style>
<link href="estilos.css" rel="stylesheet" type="text/css">
<?php
include ("../includes/data.php");
@
$Nombre1 $_POST['Nombre1'];
@
$Nombre2 $_POST['Nombre2'];
@
$Email1 $_POST['Email1'];
@
$Email2 $_POST['Email2'];


$rsblog mysql_query("SELECT id, titulo, txt_principal FROM notas WHERE seccion_nota = 'Blog'");
                          list(
$bid$btitulo$btxt_principal) = mysql_fetch_array($rsblog);
                          
$rslistab = @mysql_fetch_array($rsblog);
                          
$sacar "$bid";
                          
$mostrar $btxt_principal;
$p_blogexplode("\n"$mostrar);
$rsjardines mysql_query("SELECT id, titulo, txt_principal FROM notas WHERE seccion_nota = 'Jardines'");
                          list(
$jid$jtitulo$jtxt_principal) = mysql_fetch_array($rsjardines);
                          
$rslistajar = @mysql_fetch_array($rsjardines);
                          
$mostrar $jtxt_principal;
$p_jardinesexplode("\n"$mostrar);

$rslblog mysql_query("SELECT * FROM notas WHERE seccion_nota = 'Blog' id != ".$sacar." ORDER BY id DESC LIMIT 5");
while(
$rslistablog = @mysql_fetch_array($rslblog)) { 
echo 
"<tr>";

$receptor $Email2;
//************************************************************************//
$header "From: $Nombre1 <$Email1>\n";
$header .= "To: ".$Email2."\n";
$header .= "X-Mailer: PHP4\n"//mailer
$header .= "MIME-Version: 1.0\n";
$header .= "Reply-to: ".$Email1."\n";
$header .= "Content-type: text/html; charset=iso-8859-1\n";
//************************************************************************//

$subject "Recomendación de " $Nombre1;

$cuerpo "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>
<html><head>
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>
<title>novedades por e-mail</title>
<style type='text/css'>
<!--
body {COLOR:#666666;FONT-FAMILY: helvetica;FONT-STYLE: normal;FONT-WEIGHT: normal;TEXT-DECORATION: none;}
.top{border: 0px solid #999999;border-bottom:none;background: #ffffff; MARGIN-TOP:4px; PADDING:2px;FONT-SIZE:11px;}
.bottom{border: 0px solid #999999;border-top:none;background: #ffffff; PADDING:2px;FONT-SIZE:11px;}
.ir {FONT-FAMILY:helvetica;font-size:10pt; margin:1px;font-weight:normal;TEXT-DECORATION: none;color:#fea941}
.ir:hover {TEXT-DECORATION: underline;}
h3 {font-size:8pt; margin:1px;    font-weight:normal;    }
h4{border:0px;text-align:left;width:96%;margin-left:4px;margin-top:0px;text-decoration:none;color:#fea941;}
.ordenar_foto{float:left;margin-right:4px;margin-left:1px;margin-top:4px;margin-bottom:4px;padding:1px;border:1px solid #cccccc;background-color:#FFFFFF;}
.borde{border-bottom:1px solid #e1e1e1; font-size:11px;padding-top:4px;padding-bottom:4px;margin-bottom:4px;margin-top:4px;}
.left{border-right:1px solid #e1e1e1;font-size:11px;border-top:10px solid #ffffff;background-color:#fafafa;padding-left:2px;}
.principal{background-color:#FFFF99;padding:5px;border-top:10px solid #ffffff;}
.promociones{padding-top:10px;padding-left:2px;}
hr{ width:95%; border: 1px solid #e1e1e1;}
.foto{margin-right:4px;margin-left:0px;margin-top:4px;margin-bottom:4px;padding:1px;border:1px solid #cccccc;background-color:#FFFFFF;}
center{margin-top:0px;margin-bottom:0px;}
-->
</style>
</head>

<body leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'>
<table width='500' height='82' border='0' align='center' cellpadding='0' cellspacing='0'>
                                    <tr> 
                                        <td width='500' align='left' valign='top' class='texto'>Hola " 
                                          
$Nombre2 ",<br>" .$Nombre1" le env&iacutea una recomendaci&oacute;n 
                                          <br />
                                          Este mensaje se env&iacute;a a pedido 
                                          de " 
.$Nombre1", quien proporcion&oacute; 
                                          su direcci&oacute;n de correo electr&oacute;nico<br />
                                          Lamentamos cualquier molestia que pudiera 
                                          causar 
                                        </td>
                                    </tr>
                                  </table>
                                  <table width='500' border='0' cellspacing='0' cellpadding='0' align='center' class='top'>
  <tr>
    <td><img src='/estilo/images/encabezado_home.png' border='0'/></td>
  </tr>
  <tr>
    <td class='principal'><h3>BLOG</h3><a href='/blog/nota.php?id="
.$bid."' class='ir' target='_blank'>".$btitulo."</a><br>".$p_blog[0]."<br><a href='/blog/nota.php?id=".$bid."' class='ir' target='_blank'>leer más</a></td>
  </tr>
</table>
<table width='500' border='0' cellspacing='0' cellpadding='0' align='center' class='bottom'>
  <tr>
    <td width='190' align='left' valign='top'><table width='190' border='0' cellspacing='0' cellpadding='0' class='left'>
      <tr>
        <td><h3>JARDINES</h3><a href='/estilo/leer.php?id="
.$jid."' class='ir'>".$jtitulo."</a><br><img src='estilo/fotos/".$jid."_.jpg' border='0' class='ordenar_foto'/>".$p_jardines[0]."<br>          <a href='/estilo/leer.php?id=".$jid."' class='ir'>leer más</a></td>
      </tr>
    </table></td>
    <td width='300' align='left' valign='top' class='promociones'><h3>ÚLTIMAS NOTAS</h3>
      <table width='300' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td width='300' align='left' valign='top' class='borde'><a href='blog/nota.php?id="
.$rslistablog['id']."' target='_blank' class='ir'>".$rslistablog['titulo']."</a></td>
</tr></table>     </td>  </tr></table>
</body></html>"
;}
mail($receptor,$subject,$cuerpo,$header);
  
?>
</head>

<body>
<table width="350" height="220" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td align="left" valign="top">
<table width="350" height="220" border="0" cellpadding="0" cellspacing="0" bgcolor="#F0F0F0">
        <tr>
          <td align="center" valign="middle"><table width="287" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="center" valign="middle" class="gracias">Su recomendaci&oacute;n ha sido enviada con &eacute;xito. <br>
                    <br>
                  gracias<br>
                    <br>
                  <a href="javascript:window.close();" class="listado">cerrar 
                  ventana</a></td>
              </tr>
          </table></td>
        </tr>
      </table></td>
  </tr>
</table>
</body>
</html>
espero que alguien me de una mano porque no le encuentro la vuelta, gracias
deberias poner la linea donde envias el email dentro del while.

otra cosa, en las etiquetas <img> y <a> lo ideal es poner las rutas completas y no relativas.

saludos!