Simple mail on form submit


<?php

if(isset($_POST['Submit'])){
$to = 'ravi.loyalweb@gmail.com';
$subject = $_POST['subject'];

$name_field = $_POST['Name'];
$address_field = $_POST['Address'];
$country_field = $_POST['Country'];
$postcode_field = $_POST['Postcode'];
$telephone_field = $_POST['telephone'];
$email_field = $_POST['email'];
$size_field = $_POST['size'];
$metal_field = $_POST['Metal'];

$headers = "From: $name_field <$email_field>\r\n";
$headers .= "Reply-To: $email_field\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";

$body ="Name : $name_field <br/>
Address : $address_field;<br/>
Country: $country_field;<br/>
Postcode: $postcode_field;<br/>
Telephone: $telephone_field <br/>
Email: $email_field <br/>
size: $size_field <br/>
Metal: $metal_field <br/>";

mail($to, $subject, $body, $headers);
}
?>
<script language="javascript">
window.location.href = "http://www.taylortrumpets.com/thank_you.html"
</script>

Advertisements

Tagged:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: