【发布时间】:2015-10-27 12:53:11
【问题描述】:
在我检查收件箱但没有看到电子邮件之前,看起来一切正常
PHP
$mail = $_POST['your_email'];
$header = 'From: ' . $mail . " \r\n";
$header .= "X-Mailer: PHP/" . phpversion() . " \r\n";
$header .= "Mime-Version: 1.0 \r\n";
$header .= "Content-Type: text/plain";
$message = "$mail want to access the private beta";
$to = 'aca.spam@gmail.com';
$subject = 'Someone want to send a future message';
mail($to, $subject, utf8_decode($message), $header);
header("location:confirmation.html");
exit;
HTML
<form method="post" id="contact_form" name="contact_form" target="_self" lang="en" action="send.php">
<div>
<b>My email is</b> <input type="text" id="your_email" name="your_email" placeholder="email@ddress.com">
<p>and I want access to the private beta.</p>
</div>
<button type="submit">YES!</button>
</form>
当我点击提交时,转到 php 文件,然后返回到 Confirmation.html。 一切正常,但我没有收到任何电子邮件。
【问题讨论】:
-
您不能将
From字段发送到您不是从其发送且未通过身份验证从其发送的域。否则,我可能会伪造你的地址,然后给世界上每个人冒充塞巴斯蒂安·苏亚雷斯发电子邮件。