<?php

//echo 'developer testing!'; die();

if ((isset($_POST['action'])) && $_POST['action']=='send_email' )
{
    
    $to = $_POST['to_email'];
    $subject = $_POST['subject'];
    $emailMessage = $_POST['message'];

    $message = "
    <html>
    <head>
    <title>Inquiry - Form</title>
    </head>
    <body>
    
    <div style='margin-top:-10px'>
    		".$emailMessage."
    	</div>";
    
      
    	
    $message.= "</body></html>";

    // Always set content-type when sending HTML email
    $headers = "MIME-Version: 1.0" . "\r\n";
    $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";

    // More headers
    $headers .= 'From: Code Sitex <info@codesitex.com>' . "\r\n";
    
    if(mail($to,$subject,$message,$headers)){
       // echo "1";
    	$parm['status'] = 1;
       echo json_encode($parm);
    }
    else{
        $parm['status'] = 0;
        echo json_encode($parm);
    }
}

?>