I am having trouble getting html to send via the mail() command on a php server. The email gets sent but the html code does not show up as html. How can I solve this. Below is the code I have the server send but it is not displaying as html in my mail browsers??
<html><table border="1"><tr><th>User Level</th><th>Number of Users</th></tr><tr><td>0</td><td>0</td></tr><tr><td>1</td><td>2</td></tr><tr><td>2</td><td>1</td></tr></table></html>
Below is how to get the content for the message
function get_tbl_lvl(){
$i=0;
$html .= '<table border="1"><tr><th>User Level</th><th>Number of Users</th></tr>';
while($i<3){
$html .= '<tr><td>'.$i.'</td><td>';
$num = num_level($i);
if($num == -1){
$html .= 'db fail';
}else{
$html .= $num;
}
$html .= '</td></tr>';
$i++;
}
$html .= '</table>';
return $html;
}
Below is the code for sending the content
$msg = '<html>'.get_tbl_lvl().'</html>';
mail($to,$subject,$msg,$headers);
echo get_tbl_lvl();