500 internal server error php mail how to fix?

In the processing script mail.php error 500 internal server error.

mail.php:
<?php
// Check for empty fields
if(empty($_POST['name']) ||
 empty($_POST['phone']) ||
 empty($_POST['message']) ||
{
 echo "No arguments Provided!";
 return false;
}

$name = $_POST['name'];
$phone = $_POST['phone'];
$message = $_POST['message'];

// Create the email and send the message
$to = 'nemonab@gmail.com'; // Add your email address inbetween the " replacing yourname@yourdomain.com - This is where the form will send a message to.
$email_subject = "New order";
$email_body = "From the website received a new order, it would be necessary to call back.\n\n"."Customer data:\n\Pima: $name\n\n Pharod: $message\n\n nomer phone: $phone";
$headers = "From: tsnochi.syte@gmail.com\n"; // This is the email address the generated message will be from. We recommend using something like noreply@yourdomain.com.
$headers .= "Reply-To email";
mail($to,$email_subject,$email_body,$headers);
return true;
?>


The JS code:
$(".contForm").validate({
 rules: {
 name: {
 required: true
},
 phone: {
 required: true,
},
 message: {
 required: true
}
},
 tooltip_options: {
 name: {
 placement: 'top'
},
 phone: {
 placement: 'top'
},
 message: {
 placement: 'top',
}
},
 submitHandler: function(form) {
$.ajax({
 type: "POST",
 url: "/mail.php",
 data: $(form).serialize(),
 timeout: 3000,
 success: function() {
$(".contForm").hide();
$(".modalContForm").hide();
$("h2.form").hide();
 $('.form-pad').append('<h2 class="form">Application form is accepted we will call You back!</h2>')
},
 error: function() {
$(".modalContForm").hide();
$(".contForm").hide();
$("h2.form").hide();
 $('.form-pad').append('<h2 class="form">an error Occurred, please try again later.</h2>')
}
});
 return false;
}
});
June 16th 19 at 12:54
2 answers
June 16th 19 at 12:56
Solution
I'm not a programmer, but in my condition php extra "OR" at the end:

empty($_POST['message']) ||
And brackets, there is need to close - Ivory.Swift90 commented on June 16th 19 at 12:59
Honestly, I did not understand what was meant, exactly where there "OR"? - giovani_Swift commented on June 16th 19 at 13:02
,
"||"
they are the same "or"
they are the same "or" - kavon.Murphy commented on June 16th 19 at 13:05
Yes , the brackets with the condition I noticed. - elizabeth_Russel commented on June 16th 19 at 13:08
June 16th 19 at 12:58
Solution
okay
if(empty($_POST['name']) ||
 empty($_POST['phone']) ||
 empty($_POST['message']) )
{
 echo "No arguments Provided!";
 return false;
 }

time or to learn to read logs, or you can develop in Notepad and with the included error output.

Find more questions by tags PHP