Can somebody help me with this. I've build script in php to export mysql search query via email. Everything is working fine, except data is exported and looks like string, is it possible to have same data but in basic html table so it looks better? Please see atatched immage how it lloks when receiving email. Thank you in advance:
while ($row = mysql_fetch_object($query)) {
$string .= ""."Product Name: ".$row->product_name."".""."Product Code: ".$row->product_code."".""."Product Color: ".$row->product_color_name."".""."Product Package/Size: ".$row->package_name."";
}
//email parameters
$to = 'email' . ', '; // note the comma
$to .= '';
$subject = "Low Stock $date_o - $date_a";
// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: Low Stock Notification' . "\r\n";
$message = "$e_message
Dear Admin,<br><br>
Stock of some or one product(s) is low, see the detail below: <br><br>
$string
$footer";
mail($to,$subject,$message,$headers);
?>
actual export looks like when received
