我有一个php邮件功能,可以发送包含联系表单中内容的电子邮件。但是当我在我的网站上发送此电子邮件时。而不是from标头是输入的电子邮件地址,它是username@srv30.000webhost.com,我不知道为什么。我的PHP邮件功能如下。
$ email是用户输入的电子邮件。
编辑:主题:来自hello X-PHP脚本的评论:kwp.host22.com/form_action.php for 78.147.187.64 Message-Id:<20131124204151.478EC28021@srv30.000webhost.com>日期:2013年11月24日,星期日15:41 :51 -0500(EST) 发件人:a5485011@srv30.000webhost.com 返回路径:a5485011@srv30.000webhost.com X-OriginalArrivalTime:2013年11月24日20:41:52.0292(UTC)FILETIME = [9B09B640:01CEE955]
完整的php脚本:
$name = ($_GET['Name']) ? $_GET['Name'] : $_POST['Name'];
$email = ($_GET['Email']) ?$_GET['Email'] : $_POST['Email'];
$phone = ($_GET['Phone']) ?$_GET['Phone'] : $_POST['Phone'];
$comment = ($_GET['Comment']) ?$_GET['Comment'] : $_POST['Comment'];
// flag to indicate which method it uses. If POST set it to 1
if ($_POST) $post=1;
// Simple server side validation for POST data, of course, you should validate the email
if (!$name) $errors[count($errors)] = 'Please enter your …Run Code Online (Sandbox Code Playgroud)