I could receive the email but my php has some problem which maks the receving email looks strange, and can't use reply function on outlook. anyone could help me improve it. thank you.
this contact.php
<body>
<?php
$field_firstname = $_POST['firstname'];" ".$_POST['lastname'];
$field_emailaddress= $_POST['emailaddress'];
$field_telepohone = $_POST['telephone'];
$field_country = $_POST['country'];
$field_business = $_POST['business'];
$field_comments = $_POST['comments'];
$mail_to = 'info@ABC.com';
$subject = 'Message from a site visitor '.$field_name;
$body_message = 'From: '.$field_name."\n";
$body_message .= 'E-mail: '.$_POST['emailaddress']."\n";
$body_message .= 'Message: \n'.$_POST['emailaddress']."\n";
$body_message .= $_POST['telephone']."\n";
$body_message .= $_POST['country']."\n";
$body_message .= $_POST['business']."\n";
$body_message .= $_POST['comments'];
$headers = 'From: '.$_POST['emailaddress'].'\r\n';
$headers .= 'Reply-To: '.$_POST['emailaddress'].'\r\n';
$mail_status = mail($mail_to, $subject, $body_message, $headers);
if ($mail_status) { ?>
<script language="javascript" type="text/javascript">
alert('Thank you for the message. We will contact you shortly.');
<!--
window.location.href = "http://www.ABC.com/thankyou.html";
//-->
</script>
<?php
}
else { ?>
<script language="javascript" type="text/javascript">
alert('Message failed. Please check the items required');
<!--
window.location.href = "http://www.ABC.com/contact.html";
//-->
</script>
<?php
}
?>
this is contact.html
<form action="contact.php" method="post" name="form1" target="_blank" class="email" id="form1" onsubmit="MM_validateForm('firstname','','R','lastname','','R','emailaddress','','NisEmail','comments','','R');return document.MM_returnValue">
<p>If you need more information about our inspection, sourcing, auditing, and verification service, <br />
<br />
pls contact below address or just fill in the form below, our customer service will get you back <br />
<br />
as soon as possible. thank you for considering ABC!</p>
<p>First Name:
<label for="firstname"></label>
<input type="text" name="firstname" id="firstname" />
<br />
<br />
Lsat Name:
<label for="lastname"></label>
<input type="text" name="lastname" id="lastname" />
<br />
<br />
Email Address:
<label for="emailaddress"></label>
<input type="text" name="emailaddress" id="emailaddress" />
<br />
<br />
Telephone:
<label for="telephone2"></label>
<input type="text" name="telephone" id="telephone" />
<label for="TEL"></label>
<br />
<br />
Country:
<label for="country"></label>
<select name="country" id="country">
<option>Australia</option>
<option>Austria</option>
<option>Belgium</option>
<option>Czech Republic</option>
<option>Denmark</option>
<option>Finland</option>
<option>France</option>
<option>Germany</option>
<option>Greece</option>
<option>Hungary</option>
<option>Italy</option>
<option>Netherlands</option>
<option>Norway</option>
<option>Poland</option>
<option>Romania</option>
<option>Russia</option>
<option>Spain</option>
<option>Sweden</option>
<option>Switzerland</option>
<option>United Kingdom</option>
<option>Canada</option>
<option>Mexico</option>
<option>United States of America</option>
<option>Argentina</option>
<option>Brazil</option>
<option>New Zealand</option>
<option>Egypt</option>
<option>Iran</option>
<option>Israel</option>
<option>Kuwait</option>
<option>Saudi Arabia</option>
<option>Turkey</option>
<option>Japan</option>
<option>South Korea</option>
<option>Vietnam</option>
<option>other</option>
</select>
<br />
<br />
Business:
<label for="business"></label>
<select name="business" id="business">
<option>wholesale</option>
<option>retail</option>
<option>industrial</option>
<option>services</option>
<option>distributor</option>
<option>manufacturer</option>
<option>importer</option>
<option>other</option>
</select>
<label for="telephone"></label>
<label for="FAX"></label>
<br />
<br />
Comments:<br />
<br />
<label for="comments"></label>
<textarea name="comments" id="comments" cols="45" rows="5"></textarea>
<br />
<br />
<input name="submit" type="submit" id="submit" onclick="MM_validateForm('firstname','','R','lastname','','R','emailaddress','','RisEmail','telephone','','NisNum','comments','','R');return document.MM_returnValue" value="Submit" />
<br />
</p>
</form>
another problem is that the verification function doesn't work, people could send me blank email, but when I try myself, it works. thank you for you help.