$(document).ready(function(){
  $("#send_email_button").click(function(){
    var  message = $('#message').val();
    var  name = $('#name').val();
    var  email = $('#email').val();
    var  subject = $('#subject').val();
    var  ajax_url = 'phpmail_api.php?message=' + message + "&name=" + name + "&email=" + email + "&subject=" + subject;
    $.ajax({url: ajax_url, success: function(result){
      $("#sendmessage").html(result);
      //alert(result + message);
      $("#sendmessage").show();
      $('#message').val("");
      $('#name').val("");
      $('#email').val("");
      $('#subject').val("");
    }});
  });
});
