How to pass values from a html page using jQuery to PHP and get a response back?
<p>I am trying to pass the values from jQuery to PHP. Here is my code,</p>

<p>jQuery Function:</p>

<pre><code>$(document).ready(function () {
        $("#contact_form").submit(function () {
            var RequesterName = $("#RequesterName").val(); 
            var Requestoremail = $("#Requestoremail").val();
            var Subject = '[Request] Mail Subject';
            $.ajax({
                type: 'post',
                dataType: 'json', 
                url: 'sendmail.php',
                data: { RequesterName_val: RequesterName, Requestoremail_val: Requestoremail, Subject_val: Subject },
                success: function (data) {
                    alert('Mail Sent Successsfully');
                }
            });
        });
    })
</code></pre>

<p>and PHP:</p>

<pre><code>&lt;?php
    $to = $_POST['RequesterName_val'];
    $subject = $_POST['Subject_val'];
    $RequesterName = $_POST['RequesterName_val'];
    $Requestoremail = $_POST['Requestoremail_val'];

     $message = "RequesterName:".$RequesterName."   , Requestoremail:".$Requestoremail."    ";

                $headers = "MIME-Version: 1.0" . "\r\n";
                $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";

                // More headers
                $headers .= 'From: &lt;'.$Requestoremail.'&gt;' . "\r\n";
                $headers .= "Reply-To: '.$Requestoremail.'\r\n";

                 if (mail($to,$subject,$message,$headers)) {
                        echo "Success";
                 } else {
                             echo "Error";
                 }

      die();

?&gt;
</code></pre>

<p>It seems mail is triggering from php  but I am not getting a response back and "Mail Sent Successfully" is not displaying in jQuery? How can i get a response for success and failure of mail trigger?</p>