I have following php file which I am placing as a form action,the coding seems right as i get all variables value when I echo the statements,but I dont know what happen to this,I am not getting this to email-id. Also my form tag is like
Please help.
Code:
<form action="enquiry.php" method="POST" name="form" id="form" onSubmit="return valid_form()" target="_self"> <input type="hidden" name="success_page" value="enquiry.html" /> ................ ............. ....... <input name="submit" value="Submit Enquiry" type="submit" </form>
Code:
<?php $nature=$_POST['nature']; $enquiry=$_POST['enquiry']; $quantity=$_POST['quantity']; $company=$_POST['company']; $name=$_POST['name']; $email=$_POST['email']; $phone_country_code=$_POST['phone_country_code']; $phone_area_code=$_POST['phone_area_code']; $phone=$_POST['phone']; $fax=$_POST['fax']; $addr=$_POST['addr']; $city=$_POST['city']; $code=$_POST['code']; $country=$_POST['country']; # Email to Form Owner $emailSubject = "Online Enquiry"; $emailBody = "Nature of Business:$nature\n" . "Requirement : $enquiry\n" . "Quantity : $quantity\n" . "Company name : $company\n" . "Name : $name\n" . "Email : $email\n" . "Country Code : $phone_country_code\n" . "Area Code : $phone_area_code\n" . "Phone : $phone\n" . "Fax : $fax\n" . "Address : $addr\n" . "City : $city\n" . "Zip code : $code\n" . "Country Name: $country\n" . ""; $emailTo ="user1@example.com"; $emailFrom="Enquiry"; $emailHeader = "From: $emailFrom\n" . "MIME-Version: 1.0\n" . "Content-type: text/plain; charset=\"ISO-8859-1\"\n" . "Content-transfer-encoding: 7bit\n"; mail($emailTo, $emailSubject, $emailBody, $emailHeader); header("Location: enquiry.html"); //include("coupon.php"); $successpage=$_POST{"success_page"}; ?>
Comment