<?php
//if(isset($_POST['sendEnquiry'])){
$message="Enquiry Details:<br /><br />Customer Name: ".$_POST['your-name']."<br />Email ID: ".$_POST['your-email']."<br />Subject: ".$_POST['your-subject']."<br />Message: ".$_POST['your-message'];

//echo $message;
				
require('../phpmailer/class.phpmailer.php');
$fromad="support@domain.com";
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPDebug = 0;
$mail->SMTPAuth = TRUE;
$mail->Port     = 587;  
$mail->Username = "support@domain.com";
$mail->Password = "support@@123";
$mail->Host     = "domain.com";
$mail->Mailer   = "smtp";
$mail->SetFrom("support@domain.com", 'domainName');
$mail->AddReplyTo("adminemailid", 'admin_name');
$mail->AddAddress("customeremailid@gmail.com");
$mail->AddAddress($email);	
$mail->Subject = "Enquiry Details";
$mail->WordWrap   = 80;
$mail->MsgHTML($message);
$mail->IsHTML(true); 
if(!$mail->Send()){
  echo "<script>alert('Some error occure!')</script>";
  echo "<script>window.location='".$_SERVER['HTTP_REFERER']."'</script>";
}else{
	
		echo "<script>alert('thanks for for submitting Details , Our Team Will Contact You Soon.')</script>";
		echo "<script>window.location='".$_SERVER['HTTP_REFERER']."'</script>";
	}
	//}

?>
