<?php 
#EMAIL FUNCTIONS
function sendHTMLemail($HTML,$from,$to,$subject)
{
// First we have to build our email headers
// Set out "from" address
    $headers = "From: $from\r\n"; 
	if($cc!='')
		$headers.= "CC: $cc\r\n"; 
// Now we specify our MIME version
    $headers .= "MIME-Version: 1.0\r\n"; 
// Create a boundary so we know where to look for
// the start of the data
    $boundary = uniqid("HTMLEMAIL"); 
// First we be nice and send a non-html version of our email
    $headers .= "Content-Type: multipart/alternative;".
                "boundary = $boundary\r\n\r\n"; 
    $headers .= "This is a MIME encoded message.\r\n\r\n"; 
    $headers .= "--$boundary\r\n".
                "Content-Type: text/plain; charset=ISO-8859-1\r\n".
                "Content-Transfer-Encoding: base64\r\n\r\n"; 
    $headers .= chunk_split(base64_encode(strip_tags($HTML))); 

// Now we attach the HTML version

    $headers .= "--$boundary\r\n".
                "Content-Type: text/html; charset=ISO-8859-1\r\n".
                "Content-Transfer-Encoding: base64\r\n\r\n"; 
    $headers .= chunk_split(base64_encode($HTML)); 

// And then send the email ....
    mail($to,$subject,$headers);
}

  
if(isset($_POST['submit_x']))
{
	$full_name=$_POST["full_name"];
	$company_name=$_POST["company_name"];
	$address=$_POST["address"];
	$email_id=$_POST["email_id"];
	$website=$_POST["website"];
	$mobile=$_POST["mobile"];
	$enquiry_details=$_POST["enquiry_details"];
	
	
	$from=$email_id;
	//$to="sunita@omwebsolution.com";
	$to="info@suryatechnocrats.com";
	$cc="suryatechnocrats@gmail.com";
	//$cc="mudassir@omwebsolution.com";
	
	$sub= "Enquiry For Suryatechnocrats";
	$message= "*************Enquiry For Suryatechnocrats ****************\n\n".
			"Name :".$full_name. "\n";
			
			if($company_name!="")
			{
				$message.="Company Name :".$company_name. "\n";
			}
			if($website!="")
			{
				$message.="Website :".$website. "\n";
			}
			
			$message.="Address :".$address. "\n".
			"Email Id :".$email_id. "\n".
			"Mobile :".$mobile. "\n".
			"Enquiry Details :".$enquiry_details." ";
	
	$headers .= 'From: <'.$email_id.'>' . "\r\n";
	$headers .= 'Cc: '.$cc.'' . "\r\n";
	
	mail($to,$sub,$message,$headers);
	//sendHTMLemail($message,$from,$to,$sub); 
	//mail($to,$sub,$message);
	header("location:thank.html");

}
?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
</body>
</html>
