Email body doesn’t show the input values from the form

php

#1

Hi Guys, I have created a form and posted the data to a php file using Dreamweaver. The php file then sends a email. But the email body doesn’t show the input values from the form? I have checked the code on the form and the php file and all seems 100%. Maybe you guys can see the problem.

HTML form

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<script src='https://www.google.com/recaptcha/api.js'></script>
<title>Contact Us</title>
<style type="text/css">
.Form_heading {
	font-weight: bold;
	font-size: 36px;
	font-family: 'Halcom', sans-serif;
}
.sub_heading {
	font-style: italic;
	font-family: 'Halcom', sans-serif;
	font-size: 10px;
}
#myform #spryradio1 table {
	font-family: 'Halcom', sans-serif;
}
Labels {
	font-family: 'Halcom', sans-serif;
}
#myform p {
	font-family: 'Halcom', sans-serif;
}
</style>
<script src="SpryAssets/SpryValidationRadio.js" type="text/javascript"></script>
<script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<script src="SpryAssets/SpryValidationTextarea.js" type="text/javascript"></script>
<script src="SpryAssets/google.js" type="text/javascript"></script>
<link href="SpryAssets/SpryValidationRadio.css" rel="stylesheet" type="text/css" />
<link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
<link href="SpryAssets/SpryValidationTextarea.css" rel="stylesheet" type="text/css" />
<style type="text/css">
body,td,th {
	font-family: 'Halcom', sans-serif;
	
}
</style>
<link href="SpryAssets/google.js.css" rel="stylesheet" type="text/css" />
<link href="SpryAssets/SpryValidationRadio.css" rel="stylesheet" type="text/css" />
<link href="SpryAssets/SpryValidationTextField.js.css" rel="stylesheet" type="text/css" />
<link href="SpryAssets/SpryValidationRadio.js.css" rel="stylesheet" type="text/css" />
<link href="SpryAssets/SpryValidationTextarea.js.css" rel="stylesheet" type="text/css" />
<link href="SpryAssets/google.js.css" rel="stylesheet" type="text/css" />
<link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
<link href="SpryAssets/SpryValidationTextarea.css" rel="stylesheet" type="text/css" />
</head>

<body style="margin-left: 20px">
<form action="thankyou_accounts.php" method="post" id="myform" style="font-size:10px" >
	<select onchange="location = this.value;">
		<option style="font-family:'Halcom" value="http://www.new2.safe-mine.co.za/forms/contact_intro.html" >Please select department</option>
		<option style="font-family:'Halcom" value="http://www.new2.safe-mine.co.za/forms/contact_accounts.html" selected>Accounts Query</option>
		<option style="font-family:'Halcom" value="http://www.new2.safe-mine.co.za/forms/contact_sales.html">Sales/Quote Query</option>
		<option style="font-family:'Halcom" value="http://www.new2.safe-mine.co.za/forms/contact_complaint.html">Complaint</option>
		<option style="font-family:'Halcom" value="http://www.new2.safe-mine.co.za/forms/contact_compliment.html">Compliment</option>
		<option style="font-family:'Halcom" value="http://www.new2.safe-mine.co.za/forms/contact_technical.html">Technical Query</option>
		<option style="font-family:'Halcom" value="http://www.new2.safe-mine.co.za/forms/contact_exco.html">Escalated to Exec. Management</option>
</select>
  <p><span id="sprytextfield7">
    <label for="Company/Private">Company:<br />
    </label>
    <input name="company" type="text" id="company" size="30" />
  <span class="textfieldRequiredMsg">A value is required.</span></span></p>
  <p><span id="sprytextfield1">
    <label for="First Name3">Full Name:</label>
<span class="textfieldRequiredMsg">A value is required.</span></span></p>
  <input name="name" type="text" id="name" size="30" />
<p><span id="sprytextfield3">
  <label for="Email2">Email: </label>
<span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span></p>
  <input name="email" type="text" id="email" size="30" />
  <p><span id="sprytextfield4">
  <label for="Telephone Number">Contact Number:</label>
<span class="textfieldRequiredMsg">A value is required.</span></span></p>
  <input name="number" type="text" id="number" size="30" />
  <p><span id="sprytextarea1">
  <label for="Enquery/Request2">Enquery:</label>
  <br />
    <textarea name="message" id="message" cols="30" rows="5" style="font-size:12px"></textarea>
<span class="textareaRequiredMsg">A value is required.</span></span>  </p>
  <div class="g-recaptcha" data-size="compact" data-sitekey="6LcPKFUUAAAAAKbH6Y89D72kAqZPYby3DHsXucZ5"></div>
    <input type="submit" name="Submit" id="Submit" value="Submit" />
    <input type="reset" name="Reset" id="Reset" value="Reset" />
</form>
<script type="text/javascript">
var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3", "email");
var sprytextfield4 = new Spry.Widget.ValidationTextField("sprytextfield4");
var sprytextarea1 = new Spry.Widget.ValidationTextarea("sprytextarea1");
var sprytextfield7 = new Spry.Widget.ValidationTextField("sprytextfield7");
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
</script>
</body>
</html>



**PHP file**

		$name=$_POST['name'];
		$email=$_POST['email'];
		$company=$_POST['company'];
		$message=$_POST['message'];
		$contact=$_POST['number'];
		
		$email_from = 'webmaster@safe-mine.co.za';//<== update the email address
		$email_subject = "New Submission from SAFEmine website";
		$email_body = 'Company:$company \n Name:$name \n Contact Number:$contact \n Enquery:$message \n';
    
		$to = "paul.bland.82@gmail.com";//<== update the email address
		$headers = "From: $email_from \r\n";
		$headers = "Reply-To: $Email \r\n";
		
mail($to,$email_from,$email_subject,$email_body,$headers);

		echo '<p style="font-family: halcom; font-size: 12;">Thank you for contacting us. We will be in touch with you very soon.</p>';

Show my code?