Hey,
Im trying to create a script using PHP Mailer to send alerts to users who have signed up. But i need to include a repeated region containing the new listings information. How do i do this between the " without causing problems?
while ($row = mysql_fetch_array ($result))
{
// HTML body
$body = "
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">
<style type=\"text/css\">
<!--
table, td, tr {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
color: #000000;
}
A {
text-decoration: none;
}
.sm {
font-size: 10px;
text-decoration: none;
}
-->
</style>
</head>
<body>
<table width=\"500\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">
<tr>
<td><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
<tr>
<td>SITE LOGO<td>
<td align=\"right\" nowrap</td>
</tr>
</table></td>
</tr>
<tr><td><hr size=\"1\" color=\"#CCCCCC\"></td></tr>
<tr>
<td> </td>
</tr>
<tr>
<td><h3>New Dress Listings!</h3></td>
</tr>
<tr>
<td>Heres whats new this past week:
****************************************************************
************* REPEAT REGION NEEDS TO GO HERE *******************
****************************************************************
</td>
</tr>
<tr>
<td><hr size=\"1\" color=\"#CCCCCC\"></td>
</tr>
<tr>
<td class=\"sm\"></td>
</tr>
</table>
</body>
</html>
";
// Plain text body (for mail clients that cannot read HTML)
$text_body = "Hello " . $row["full_name"] . ", \n\n";
$text_body .= "Your personal photograph to this message.\n\n";
$text_body .= "Sincerely, \n";
$text_body .= "PHPMailer List manager";
$mail->Body = $body;
$mail->Subject = "New listings";
$mail->AltBody = $text_body;
$mail->AddAddress($row["a_email"], $row["a_email"]);
if(!$mail->Send())
echo "There has been a mail error sending to " . $row["a_email"] . "<br>";
// Clear all addresses and attachments for next loop
$mail->ClearAddresses();
$mail->ClearAttachments();
Thanks in advance for any help.
Danny