Ver Mensaje Individual
  #4 (permalink)  
Antiguo 06/09/2007, 21:20
Fridureiks
 
Fecha de Ingreso: julio-2005
Ubicación: Buenos Aires, Argentina
Mensajes: 1.304
Antigüedad: 18 años, 9 meses
Puntos: 6
Re: Enviar email con contenido de consulta

Ahora queda un poco mas claro, fijate que utilizas <?php y ?> y el bucle while dentro de una variable PHP, cosa que está mal. Una posible solución podría ser la siguiente:


Código PHP:
<?php
$de
="[email protected]"
$destinatario="[email protected]"
$tema="NEWSLETTER";  

$shtml="
<html>
<head>
<title>NEWSLETTER</title>
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>
</head>
<body bgcolor='#FFFFFF' leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'>
<table width='101%' border='0'>
  <tr>
    <td>"
;

include(
"newsletterconexion.php");
$numero $_POST['numero'];
$sql="SELECT * FROM $tbl_name WHERE numero='$numero' AND tipo='contenido'";
$result=mysql_query($sql);

while(
$rows=mysql_fetch_array($result))
{

$shtml .= '<font size="2" face="Verdana, Arial, Helvetica, sans-serif">' $rows['titulo'] . '</font><br>
<font size="2" face="Verdana, Arial, Helvetica, sans-serif">' 
$rows['texto'] . '</font>';
}

$shtml .= "
   </td>
  </tr>
</table>
</body>
</html>"
;

$sheader="From:".$sfrom."nBCC:[email protected]:".$de."n";
$sheader=$sheader."X-Mailer:PHP/".phpversion()."n";
$sheader=$sheader."Mime-Version: 1.0n";
$sheader=$sheader."Content-Type: text/html";
mail($destinatario,$tema,$contenido,$sheader);
?>
Es muy probable que haya algun error de sintaxis, pero la idea es esta basicamente. Espero que te sirva.

Saludos
__________________
Federico.

Mi página: www.jourmoly.com.ar