Hello fellow citizens of ....oh skip all that... I am experiencing some difficulty trying to output html via my cron and I have checked other responses to this issue. But, I can’t seem to get it right so I’m hoping someone out there can assist me. The data pulls correctly and the cron email sends but what I end up with is my data with all the html tags appended. I have tried moving the $to and $header out of the while loop, above the while loop, below the while loop, and also tried with everything inside the while loop with only the $message being the one call to dtat $row etc and then echo'd that from within the loop. I have tried two versions of ---
( $headers .= 'Content-type:text/html;charset=iso-8859-1'
. "
";)
and
( $headers .= 'Content-type:text/html;charset=utf-8-1' .
"
";)
So any assistance would be great! Cheers!
$db = new MySQLi('------', '------', '------', '------');
if ($db->connect_error) {
$mese = $db->connect_error; } else {
$sql = "SELECT * FROM table";
$result = $db->query($sql);
while ($row = mysqli_fetch_assoc($result)) {
$to = "some@gmail.com";
$headers = 'MIME-Version: 1.0' . "
";
$headers .= 'Content-type:text/html;charset=iso-8859-
1'
. "
";
$message = "<html>";
$message .= "<head></head>";
$message .= "<body>";
$message .= '<ul><li>' . $row['item'] .'</li></ul>';
echo $message;
$message .= "</body>";
$message = "</html>";
$from = "somewhere@.someplace.net"; $subject = "checking php
mail";
mail($headers, $to,$subject,$message, $from);
}
}
?>