hola gente, estoy haciendo envío masivo para una lista de correo, todo anda bien, pero tengo una duda que me complica la vida, tal vez sea que estoy muy cansado o sea muy bruto..
la cuestion es la siguiente, necesito hacer un mail con formato html (ya lo hice), necesito "chupar" los mails de la lista de correo (ya esta ok), lo que me falta es agregar al formato hmtl (archivo php, el contenido del mail que fue pasado via form).
les muestro lo que hago..
test_mail.php
Código PHP:
<?php
$contenido = $_POST['contenido'];
include_once('../class.phpmailer.php');
include("conex.phtml");
$link=Conectarse();
$result=mysql_query("select * from email",$link);
$query2= "INSERT INTO datos (contenido)
VALUES ('$contenido')";
$result2 = mysql_query($query2);
$mail = new PHPMailer(); // defaults to using php "mail()"
$body = $mail->getFile('mail.php');
$body = eregi_replace("[\]",'',$body);
$mail->From = "--------";
$mail->FromName = "-----------";
$mail->Subject ="----";
$mail->MsgHTML($body);
while($row = mysql_fetch_array($result)) {
$mail->AddAddress($row['mail']);
}
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message sent!";
}
?>
mail.php
Código PHP:
<?php
include("conex.phtml");
$link=Conectarse();
$result=mysql_query("select contenido from datos",$link);
$row = mysql_fetch_array($result)
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin título</title>
</head>
<body>
<table width="100" border="0" cellspacing="0" cellpadding="0">
<tr>
<th scope="row"><img src="2dbotc7.jpg" width="729" height="150" /></th>
</tr>
<tr>
<th scope="row"> <?php echo $row["contenido"]; ?></th>
</tr>
<tr>
<th scope="row"><img src="2my19wi.jpg" width="799" height="281" /></th>
</tr>
<tr>
<th scope="row"><img src="5kn56u.jpg" width="799" height="195" /></th>
</tr>
<tr>
<th scope="row"></th>
</tr>
</table>
</body>
</html>
muchas gracias, les comento que el registro se carga perfecto a la bd, y el proceso de recoger info de la base ya lo hice otras veces, pero igual sigo sin ver lo que hago mal..
espero me puedan dar una mano.