I am trying to send a simple HTML e-mail from PHP. so i create a html form and a php script to send it,the email is sending without problem but when i check this email in gmail i get this the body is not a table all what i have is html tag with information
my php script :
<?php
$name = $_POST['txtfullname'];
$email = $_POST['txtemail'];
$comments = $_POST['Comments'];
$phone = $_POST['optmobileno'];
$phone .= $_POST['txtmobileno'];
$date = $_POST['birthdate'];
$country = $_POST['optcountry'];
$level= $_POST['optprogrammelevel'];
$programme= $_POST['txtprogrammepreference'];
$from = "From: subscription@sendmail.com";
$to = "example@sendmail.com";
$subject = 'New Students';
$message = '<html><body>';
$message .= '<table rules="all" style="border-color: #666;" cellpadding="10">';
$message .= "<tr style='background: #eee;'><td><strong>Name:</strong> </td><td>" . strip_tags($name) . "</td></tr>";
$message .= "<tr><td><strong>Email:</strong> </td><td>" . strip_tags($email) . "</td></tr>";
$message .= "<tr><td><strong>Phone:</strong> </td><td>" . strip_tags($phone) . "</td></tr>";
$message .= "<tr><td><strong>Birthdate:</strong> </td><td>" . strip_tags($date) . "</td></tr>";
$message .= "<tr><td><strong>Contry of residence:</strong> </td><td>" . strip_tags($country) . "</td></tr>";
$message .= "<tr><td><strong>Programme Level:</strong> </td><td>" . strip_tags($level) . "</td></tr>";
$message .= "<tr><td><strong>Area of Study:</strong> </td><td>" . strip_tags($programme) . "</td></tr>";
$message .= "<tr><td><strong>Comments:</strong> </td><td>" . htmlentities($comments) . "</td></tr>";
$message .= "</table>";
$message .= "</body></html>";
$headers = 'From: '.$from."\r\n".
'Reply-To: '.$from."\r\n" .
'X-Mailer: PHP/' . phpversion();
@mail ($to, $subject, $message , $headers)
?>