我正在接触形式的问题,它成功验证,我得到Jquery响应"您的电子邮件已成功发送"但问题是电子邮件不能交付。我在这里粘贴代码请帮助我。它是一个基于HTML的网站,但是。
联系FORM.HTML
<!-- contact-area start -->
<div class="contact-area ptb-120 bg-2">
<div class="container">
<div class="row">
<div class="col-md-4 col-xs-12">
<div class="contact-wrap">
<h3>CONTACT INFO</h3>
<p>#123 King , Melbourne vic 3000, Sydney New City, Australia</p>
<p>(+08) 9673 123 765,(+08) 9673 148 112</p>
<p>hello@university.com</p>
</div>
</div>
<div class="col-md-8 col-xs-12">
<div class="contact-form">
<div class="cf-msg"></div>
<form action="mail.php" method="post" id="cf">
<div class="row">
<div class="col-md-6 col-sm-6 col-xs-12">
<input type="text" placeholder="Name" id="fname" name="fname">
</div>
<div class="col-md-6 col-sm-6 col-xs-12">
<input type="text" placeholder="Email" id="email" name="email">
</div>
<div class="col-md-12 col-sm-12 col-xs-12">
<input type="text" placeholder="Subject" id="subject" name="subject">
</div>
<div class="col-md-12 col-sm-12 col-xs-12">
<textarea class="contact-textarea" placeholder="Message" id="msg"
name="msg"></textarea>
</div>
<div class="col-md-12 col-sm-12 col-xs-12">
<button id="submit" class="cont-submit btn-contact" name="submit">Submit
A Message</button>
</div>
</div>
</form>
MAIL.PHP
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
//Taking all values
$to = "shijumax@gmail.com";
$fname = $_POST['fname'];
$email = $_POST['email'];
$subject = $_POST['subject'];
$msg = $_POST['msg'];
$output = "Name: ".$fname."\n\nSubject: ".$subject."\n\nMessage:
".$msg;
$headers = 'FROM: "'.$email.'"';
$send = mail($to, $fname, $output."\n\n***This message has been
sent from me", $headers);
$body = "Name: ".$fname."\n E-Mail: $email\n Message:\n $msg";
echo "Data has been submitted to $to!";
mail($to, $subject, $body);
}
?>