电子邮件发送" mailto"没有显示在我的Gmail收件箱HTML中

时间:2016-03-13 13:22:01

标签: html mailto

我做了一个表格,你可以填写一些细节,当你点击"发送"它发送到你的电子邮件,它对我来说很好,但人们告诉我他们点击发送但我没有在我的收件箱中看到任何内容,我希望有人得到一个解决方案,谢谢

<form action="MAILTO:myemail@gmail.com?subject= Intro request" method="post" enctype="text/plain">

1 个答案:

答案 0 :(得分:0)

只需使用PHP发送电子邮件:

电子邮件输入的HTML表单:

<form id="main-contact-form" class="contact-form" name="contact-form" method="post" action="sendemail.php">
   <input type="text" name="name" class="form-control" required="required" placeholder="Name">
   <input type="email" name="email" class="form-control" required="required" placeholder="Email address">
   <textarea name="message" id="message" required="required" class="form- control" rows="8" placeholder="Message"></textarea>
   <button type="submit" id="submit" class="btn btn-danger btn-lg">Send Message</button>
</form>

单击提交按钮后,表单将被发送到服务器,由PHP脚本处理。

sendEmail.php:

$name = $_POST['name'];
$email = $_POST['email'];
$subject = 'query';
$message = $_POST['message'];
$email_from = $email;
$email_to = 'myemail@gmail.com';

$body = 'Name: ' . $name . "\n\n" . 'Email: ' . $email . "\n\n" . 'Subject: ' . $subject . "\n\n" . 'Message: ' . $message;

$success = mail($email_to, $subject, $body, 'From: visitor');

希望这有帮助