<?php 


	if(isset($_POST["fname"])){
			$fname = strip_tags($_POST["fname"]);
			$lname = strip_tags($_POST["lname"]);
			$email = strip_tags($_POST["email"]);
			$telephone = strip_tags($_POST["telephone"]);
			$company= strip_tags($_POST["company"]);
			$message = strip_tags($_POST["message"]);

			
			$to = "shobana.iyer@swanchambers.com";
			$subject = "Swan Chambers - Enquiry Form";
			$message = "First Name : $fname\n\nLast Name : $lname\n\nEmail : $email\n\nPhone Number : $telephone\n\nCompany Name : $company\n\nMessage : $message\n\n";
			$headers = "From: ".$email."\r\n"."BCC: pandi@designtheme.net";
			
			$ok = mail($to, $subject, $message, $headers);
			if($ok)
				echo '<script>alert("Thanks for your Enquiry"); location.href = "http://www.swanchambers.com/";</script>';
			else
				echo '<script>alert("Error while sending information! Please try again"); history.go(-1);</script>';
		
	}
?>