Give this a try then...
EDIT this is for input fields named name,email, and question and from the method post and then change the action to the name of this file.php
PHP Code:
<?php
$visitor = $_POST['name'];
$visitormail = $_POST['email'];
$notes = $_POST['question'];
if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,".")))
{
echo "<h2>The e-mail address you entered was not correct.</h2>\n";
die ("<br />Your question has not been submitted. This page will bring you back<br />in 20 seconds or you may use your browsers back menu to resubmit.\n</div>
</div>
</body>
</html>");
}
if($notes == "Questions about traveling, financial assistance, or why we do what we do ask them here...")
{
echo "Please enter your Question. In the question field";
die ("<br />You may use your browsers back button or this page will bring you back in 20 seconds.</div>
</div>
</body>
</html>");
}
if(empty($visitor) || empty($visitormail) || empty($notes )) {
echo "<br />Please Fill in all of the information.\n";
die ("<br />You may use your browsers back button or this page will bring you back in 20 seconds.</div>
</div>
</body>
</html>");
}
$sendata="Email Address to respond to:". $visitormail;
$q="Question from ". $visitor . " ". $notes . "Submitted:" . $todayis ;
$todayis = date("l, F j, Y, g:i a") ;
$attn = $attn ;
$subject = "Question from website";
$notes = stripcslashes($notes);
$message = " $todayis [EST] \n
From: $visitor ($visitormail)\n
";
$from = "From: $visitormail\r\n";
mail("LOGINNAME@MAILSITE", $subject, $sendata, $q);
?>
Bookmarks