I am trying to sending an HTML email upon an order submission , hence at first I read last inserted row in database
if(isset($_POST['submit'])) {
$sql2 = "SELECT * FROM `$db`.`pre_order` ORDER BY id DESC LIMIT 0,1;";
$result = mysql_query($sql2, $dbcon);
$row = mysql_fetch_array($result);
$id= $row['id'];
$name=$row['name'];
$address=$row['delivery_location'];
$mobile =$row['mobile'];
$email= $row['email'];
$to = $email;
$from = "[email protected]";
$subject = "Thanks You message";
$message = '
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Sundori Honey</title>
<link rel="stylesheet" href="css/table.css" type="text/css">
</head>
<body style="width:600px;">
<div class="begining">
<p>
Dear <span> <?php echo $name?></span> <br/>
Thank you for your booking. We are pleased to confirm detail as follows:
</p>
</div>
<table border="1" style="width:80% ;margin: auto;">
<tr>
<td>Confirmation Number: </td>
<td> <?php echo $id;?></td>
</tr>
<tr>
<td>Client’s Name & Contact No:</td>
<td><?php echo $name .' and ' .$mobile;?></td>
</tr><tr>
<td> Contact Address:</td>
<td><?php echo $address;?></td>
</tr>
</table>
<div class="begining">
<p>
Thanks
Sincerely,<br/><br/>
Johm<br/><br/>
Manager – Marketing & Sales<br/>
</p>
</div>
</body>
</html>
'; /*---end of HTML msg--*/
$headers = "From: $from\r\n";
$headers .= "Content-type: text/html\r\n";
mail($to, $subject, $message, $headers);
Upon form submission , I do get a msg , but the problem is , it only show something like this
The mail doesn't show any value which I have read from database and It show only two rows of the table , Even it doesn't show the footer text which is located below table .
