douhan5853 2018-07-08 16:51
浏览 39

php localhost邮件没有收到

I want to do a "Contact Me" page. I have a problem as I am not receiving the email for testing. First, I used a localhost from my terminal with the following command:

php -S 127.0.0.1:8080

When I access the localhost:8080 the website works fine, but I am not receiving any emails from the contact me. Here is my HTML & php

HTML:

      <form class="contact-form" action="contactform.php" method="post">
        <input type="text" name="name" class="form-control" placeholder="Name" required><br>
        <input type="email" name="email" class="form-control" placeholder="Email" required><br>
        <textarea name="message" class="form-control" rows="4" placeholder="Message" required></textarea><br>
        <button type="submit" name="submit" class="form-control submit">SEND MESSAGE</button>
      </form>

PHP:

<?php
if (isset($_POST['submit'])) {
$name = $_POST['name'];
$mailFrom = $_POST['email'];
$msg = $_POST['message'];

$mailTo = "monbay@inboxbear.com";
$subject = "Form Submission from ".$name;

mail($mailTo, $subject, $msg);
echo '<p>Your message has been sent!</p>';
}
?>
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥100 set_link_state
    • ¥15 虚幻5 UE美术毛发渲染
    • ¥15 CVRP 图论 物流运输优化
    • ¥15 Tableau online 嵌入ppt失败
    • ¥100 支付宝网页转账系统不识别账号
    • ¥15 基于单片机的靶位控制系统
    • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
    • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
    • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
    • ¥15 手机接入宽带网线,如何释放宽带全部速度