Code for sendeail.php
Code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Sendemail Script</title>
</head>
<body>
<!-- Reminder: Add the link for the 'next page' (at the bottom) -->
<!-- Reminder: Change 'YourEmail' to Your real email -->
<?php
$ip = $_POST['ip'];
$httpref = $_POST['httpref'];
$httpagent = $_POST['httpagent'];
$visitor = $_POST['visitor'];
$visitormail = $_POST['visitormail'];
$notes = $_POST['notes'];
$attn = $_POST['attn'];
if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,".")))
{
echo "<h2>Use Back - Enter valid e-mail</h2>\n";
$badinput = "<h2>Feedback was NOT submitted</h2>\n";
echo $badinput;
die ("Go back! ! ");
}
if(empty($visitor) || empty($visitormail) || empty($notes )) {
echo "<h2>Use Back - fill in all fields</h2>\n";
die ("Use back! ! ");
}
$todayis = date("l, F j, Y, g:i a") ;
$attn = $attn ;
$subject = $attn;
$notes = stripcslashes($notes);
$message = " $todayis [EST] \n
Attention: $attn \n
Message: $notes \n
From: $visitor ($visitormail)\n
Additional Info : IP = $ip \n
Browser Info: $httpagent \n
Referral : $httpref \n
";
$from = "From: $visitormail\r\n";
mail("YourEmail", $subject, $message, $from);
?>
<p align="center">
Date: <?php echo $todayis ?>
Thank You : <?php echo $visitor ?> ( <?php echo $visitormail ?> )
Attention: <?php echo $attn ?>
Message:
<?php $notesout = str_replace("\r", "<br/>", $notes);
echo $notesout; ?>
<?php echo $ip ?>
<a href="contact.php"> Next Page </a>
</p>
</body>
</html>
Note: You MUST modify the YourEmail Address and the link (contact.php)!!!
BTW: Some web host block the mail() function if the 'from email' is not from your domain. In other words: sometimes, the domain email address must be used - or the mail() function will not work.
P.S. Google search for 'CAPTCHA php email scripts' will show captcha scripts that you can include.