the following is my php file, however it sends the mail but its empty… please help
<?php header('Content-type: application/json'); $status = array( 'type'=>'success', 'message'=>'Email sent!' ); $name = @trim(stripslashes($_POST['name'])); $email = @trim(stripslashes($_POST['email'])); $subject = @trim(stripslashes($_POST['subject'])); $message = @trim(stripslashes($_POST['message'])); $email_from = $email; $email_to = '[email protected]'; $body = 'Name: ' . $name . "\n\n" . 'Email: ' . $email . "\n\n" . 'Subject: ' . $subject . "\n\n" . 'Message: ' . $message; $success = @mail($email_to, $subject, $body, 'From: <'.$email_from.'>'); echo json_encode($status); die; ?>I don’t think you are successfully sending the email, my guess is you’re just sending a false positive via JSON.
Why are you using @ marks before function names? Don’t you want to see what is wrong?
Take care about the right mailheaders. For more information see http://phpwiki.santhe.nl/index.php?title=De_juiste_mailheaders. (Its dutch but you will understand the example)