Php mail ошибка 500

500 internal server error mail php как исправить?

При обработке данных, скрипт mail.php выдаёт ошибку 500 internal server error.

 $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 = "Новый заказ"; $email_body = "С сайта поступил новый заказ, надо бы перезвонить.\n\n"."Данные клиента:\n\nИмя: $name\n\nГород: $message\n\nНомер телефона: $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; ?>
$(".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('

Заявка принята, мы Вам перезвоним!

') >, error: function() < $(".modalContForm").hide(); $(".contForm").hide(); $("h2.form").hide(); $('.form-pad').append('

Произошла ошибка, повторите попытку позже.

') > >); return false; > >);

Источник

Читайте также:  Top frameworks of php
Оцените статью