Sell And Buy

Sunday, 1 February 2015

How to Sent Email in Tabular Form Using PHP.


//$subject = 'Email from' . $name;
//$message1 = 'hello';
$to = '';
$subject = 'My Website Contact Info';

$msg = "<html>
<title>Contact Info</title>

<p align='center'> <img src='#' width='210' height='45'> </p>

<table cellspacing=\"4\" cellpadding=\"4\" border=\"1\" align=\"center\">
  <td align=\"center\">Room Type</td>
  <td align=\"center\"> Name</td>
  <td align=\"center\">Email</td>
  <td align=\"center\">Contact Number</td>
  <td align=\"center\">Message</td>
  <td align=\"center\">$hotels</td>
  <td align=\"center\">$name </td>
  <td align=\"center\">$email</td>
  <td align=\"center\">$contact</td>
  <td align=\"center\">$message</td>


// Make sure to escape quotes

$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: Your Site Name <Your Website Information>' . "\r\n";

mail($to, $subject, $msg, $headers);

echo"<script>var msg='Thank you, We will get in touch with you very soon..';alert(msg);
window.location.href = 'index.php';