需要向我的电子邮件发送反馈,但无法使其正常运行

时间:2014-04-23 02:58:23

标签: php forms email-validation activation-codes

好的,我在xampp需要帮助时禁止访问

<h2>Feedback Form</h2>
<?php
// display form if user has not clicked submit
if (!isset($_POST["submit"])) {
?>
<form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">
From: <input type="text" name="from"><br>
Subject: <input type="text" name="subject"><br>
Message: <textarea rows="10" cols="40" name="message"></textarea><br>
<input type="submit" name="submit" value="Submit Feedback">
</form>
<?php 
}   else {    // the user has submitted the form
// Check if the "from" input field is filled out
if (isset($_POST["from"])) {
$from = $_POST["from"]; // sender
$subject = $_POST["subject"];
$message = $_POST["message"];
// message lines should not exceed 70 characters (PHP rule), so wrap it
$message = wordwrap($message, 70);
// send mail
mail("dstokesncstudio@gmail.com",$subject,$message,"From: $from\n");
echo "Thank you for sending us feedback";
}
}
?>

0 个答案:

没有答案