<?php
if(isset($_POST['contact-form'])){
$firstname = $_POST['firstname'];
// $lastname = $_POST['lastname'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$comments = '';
$comments = $_POST['comments'];

/*
echo $firstname."<br/>";
echo $email."<br/>";
echo $phone."<br/>";
echo $comments."<br/>";
*/

$to = "meshahin007@gmail.com.com";
$subject = "New Contact Us Request";
$headers = "From: $firstname <$email>\r\n";
$headers .= "Reply-To: ". strip_tags($email) . "\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";

$msg = "
<html>
<body>
<table cellspacing='0' style='font-size:12px;line-height:135%;border-bottom:2px solid #cdcdd6'>
<tr>
<th valign='top' style='text-align:left;color:#17181c;padding:7px 9px;border-top: 2px solid #cdcdd6;'>First Name:</th>
<td style='text-align:left;color:#17181c;padding:7px 9px;border-top: 2px solid #cdcdd6;'>".$firstname."</td>
</tr>

<tr>
<th style='text-align:left;color:#17181c;padding:7px 9px;border-top: 2px solid #cdcdd6;'>Email Address:</th>
<td style='text-align:left;color:#17181c;padding:7px 9px;border-top: 2px solid #cdcdd6;'>".$email."</td>
</tr>
<tr>
<th style='text-align:left;color:#17181c;padding:7px 9px;border-top: 2px solid #cdcdd6;'>Phone Number:</th>
<td style='text-align:left;color:#17181c;padding:7px 9px;border-top: 2px solid #cdcdd6;'>".$phone."</td>
</tr>
<tr>
<th style='text-align:left;color:#17181c;padding:7px 9px;border-top: 2px solid #cdcdd6;'>Any comments or questions before we speak:</th>
<td style='text-align:left;color:#17181c;padding:7px 9px;border-top: 2px solid #cdcdd6;'>".$comments."</td>
</tr>
</table>
</body>
</html>";

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

// header("Location: thankyou.html");
 
}
?>