$con = mysql_connect("localhost","username","password");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("database", $con);
$result = mysql_query("SELECT * FROM statistics");
while($row = mysql_fetch_array($result))
{
$content_material="<tr><td>". $row['ip_address']."</td><td>".$row['number_of_pages_visited_for_whole_month']."</td><td>".$row['unique_visits']."</td></tr>".$content_material;
}
$content_material="<table width='600' border='1'><tbody><tr><td>Visitor</td><td>Visits on Separate Days</td><td>Total Number of Pages Visited</td></tr>".$content_material."</tbody></table>";
////////////END TABLE
////////////BEGIN MAILING FEATURE
$headers = "Content-type: text/html; charset=iso-8859-1";
$headers = $headers."From: \"My Self\" <webmaster_email>\r\nReply-to: webmaster_email";
$message ="Hi.<br><br>The visitor statistics for last month are as follows.<br><br>The total number of visitors last month are ".$total_visitors.". These vistors visited on ".$unique_visits." seperate days last month. The amount of pages these visitors visited over the last month is ".$number_of_pages_visited_for_whole_month.".<br><br>".$content_material."<br><br>Sincerely,<br>Automated name";
print_r($message);
mail( "
[email protected]", "Visitor Statistics for Last Month", $message, $headers, '-f webmaster_email');
Above is the code for my project. If I try and send $message with it containing $content_material, the email won't send. If I remove $content_material from $message then the email will be sent just fine. If I print_r($message), as is indicated in the code, the $message will display perfectly fine with $content_material displaying just fine as well.
I can't figure out why it is doing this. Any help would be appreciated. Thank you.