@DanInMa
Good thinking,
here goes the Output on the client side:
Code:
<p id="notify">Notify</p>
...
<script>
$("#notify").click(function(){
$.ajax({
type: "POST",
url: "/.../sendEmail.php",
data: "{ 'body': 'TEST', 'to': 'CorrectEmailHere', 'from': 'CorrectEmailHereAsWell', 'subject': 'Test' }",
dataType: "text",
complete: function (transport) { if (transport.status == 200) $("#notify").html("Success"); else alert("Please try again later"); }
});
return false;
});
</script>
Hope this helps solving my problem.
Will take a look at the error handling thing also, thanks for that!