<script language="javascript" type="text/javascript">
		alert('Thank You.');
		window.location = 'index.html';
	</script>
	
	<?php
$field_name = $_POST['yourname'];
$field_email = $_POST['youremail'];
$field_phone = $_POST['yourphone'];
$field_subject = $_POST['yoursubject'];
$field_message = $_POST['yourmessage'];

$mail_to = 'info@shardaadhyapanmandir.com';
$subject = 'Website Contact From Submitted By '.$field_name;

$body_message = 'From: '.$field_name."\n\n";
$body_message .= 'E-mail: '.$field_email."\n\n";
$body_message .= 'Phone: '.$field_phone."\n\n";
$body_message .= 'Subject: '.$field_subject."\n\n";
$body_message .= 'Message: '.$field_message;

$headers = 'From: '.$field_email."\r\n";
$headers .= 'Reply-To: '.$field_email."\r\n";

$mail_status = mail($mail_to, $subject, $body_message, $headers);

if ($mail_status) { ?>
	<script language="javascript" type="text/javascript">
		alert('Thank you for your feedback. We will contact you very shortly.');
		window.location = 'index.html';
	</script>
<?php
}
else { ?>
	<script language="javascript" type="text/javascript">
		alert('Message sending failed. Please, send us an email to info@shardaadhyapanmandir.com');
		window.location = 'index.html';
	</script>
<?php
}
?>




