出于某种原因,我没有收到任何邮件......
下面是表格:
<form action="send.php" method="POST">
<div class="cdiv">
<label for="name">Name</label>
<input class="floatlabel info" id="name" type="text" placeholder="Enter Name" required />
</div>
<div class="cdiv">
<label for="email">Email</label>
<input class="info" type="email" id="email" placeholder="Enter Your Email ID" required />
</div>
<div class="cdiv" style="height:75px;">
<label for="msg">Message</label>
<textarea class="info" id="msg" rows="3" placeholder="Enter Your Message" required></textarea>
</div>
<button type="submit" id="sendbtn">SEND</button>
</form>
继承了send.php
<?php
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$to = "myemail@gmail.com";
$subject = "webmessage";
$body = "Automated Message: \nName : $name \nEmail : $email\n\nMessage : \n$message";
mail($to,$subject,$body);
echo "Message Sent!";
?>
请告诉我这段代码有什么问题,以及为什么不发送电子邮件。在实际代码中,myemail将替换为实际的电子邮件ID。 我每次向自己发送电子邮件并查看我的收件箱时,都没有电子邮件。