Я недавно создал форму предложения для своего клиента, и я не получаю от нее никаких писем.
Мой get-a-quote.html:
<form action = "process.php" method = "post">
<div class = "top_contact">
<div class = "row">
<div class = "col-md-6 col-lg-6 col-sm-12 col-xs-12">
<p>First Name*<br/><input type = "text" required></p>
</div>
<div class = "col-md-6 col-lg-6 col-sm-12 col-xs-12">
<p>Last Name*<br/><input type = "text" required></p>
</div>
<div class = "col-md-6 col-lg-6 col-sm-12 col-xs-12">
<p>Email Address*<br/><input type = "email" required></p>
</div>
<div class = "col-md-6 col-lg-6 col-sm-12 col-xs-12">
<p>Phone*<br/><input type = "text" required></p>
</div>
<div class = "col-md-6 col-lg-6 col-sm-12 col-xs-12">
<p>Address<br/><input type = "text" ></p>
</div>
<div class = "col-md-6 col-lg-6 col-sm-12 col-xs-12">
<p>City<br/><input type = "text" ></p>
</div>
<div class = "col-md-6 col-lg-6 col-sm-12 col-xs-12">
<p>State<br/><input type = "text" ></p>
</div>
<div class = "col-md-6 col-lg-6 col-sm-12 col-xs-12">
<p>Zip<br/><input type = "text" ></p>
</div>
</div>
</div>
<div class = "bottom_details">
<h3>MOVE DETAILS</h3>
<div class = "row">
<div class = "col-md-7 col-lg-7 col-sm-12 col-xs-12">
<p>Requested move date *<br/><input type = "text" required></p>
</div>
<div class = "col-md-6 col-lg-6 col-sm-12 col-xs-12">
<p>moving from zip *<br/><input type = "text" required></p>
</div>
<div class = "col-md-6 col-lg-6 col-sm-12 col-xs-12">
<p>describe the location *<br/><input type = "text" required></p>
</div>
<div class = "col-md-6 col-lg-6 col-sm-12 col-xs-12">
<p>moving to zip *<br/><input type = "text" required></p>
</div>
<div class = "col-md-6 col-lg-6 col-sm-12 col-xs-12">
<p>describe the location *<br/><input type = "text" required></p>
</div>
<div class = "col-md-6 col-lg-6 col-sm-12 col-xs-12">
<p>type of residence<br/><input type = "text" ></p>
</div>
<div class = "col-md-6 col-lg-6 col-sm-12 col-xs-12">
<p>storage requested ?<br/><input type = "text" ></p>
</div>
</div>
<button type = "submit">GET A QUATE</button>
</div>
</form>
и мой process.php
<div class = "thank_page margin-bottom-100">
<div class = "container">
<div class = "row">
<div class = "col-md-12 col-sm-12 col-xs-12">
<div class = "thank_box">
<?php
if (isset($_POST['submit'])){
$to = "[email protected]"; // this is your Email address
$from = $_POST['email']; // this is the sender's Email address
$first_name = $_POST['name'];
$subject = "Form submission";
$subject2 = "Copy of your form submission";
$message2 = "Here is a copy of your message " . $first_name . "\n\n" . $_POST['message'];
$headers = "From:" . $from;
$headers2 = "From:" . $to;
mail($to,$subject,$message2,$headers);
mail($from,$subject2,$message2,$headers2); // sends a copy of the message to the sender
echo "Mail Sent. Thank you " . $first_name . ", we will contact you shortly.";
// You can also use header('Location: thank_you.php'); to redirect to another page.
// You cannot use header and echo together. It's one or the other.
}
?>
<br>
<a href = "index.html"><i class = "fa fa-arrow-left"></i>Go to Home page</a>
</div>
</div>
</div>
</div>
</div>
Может ли кто-нибудь помочь мне и объяснить, почему я не получаю никаких писем из этой формы предложения?






Для этих целей вам может потребоваться настроить параметры почтового сервера. Проверьте следующую ссылку для отправки писем на PHP https://github.com/PHPMailer/PHPMailer