Sorry for not posting the code:
[php]
<?PHP
//Gather up the information from the form.
$firstName = $_POST["firstName"];
$lastName = $_POST["lastName"];
$company = $_POST["company"];
$phone = $_POST["phone"];
$emailAddr = $_POST["emailAddr"];
$contactBy = $_POST["contactBy"];
$comments = $_POST["comments"];
//email assembly
$addrTo = "
[email protected]";
$subject = "Contact from...";
$body = "The following information was received by Me. \n\r";
$body = $body . "First Name:" . $firstName . "\n\r";
$body = $body . "Last Name:" . $lastName . "\n\r";
$body = $body . "Company:" . $company . "\n\r";
$body = $body . "Phone Number:" . $phone . "\n\r";
$body = $body . "Email:" . $emailAddr . "\n\r";
$body = $body . "Contact By:" . $contactBy . "\n\r";
$body = $body . "Comments:" . $comments . "\n\r";
//Send email using php mail() command.
$SpamErrorMessage = "No Websites URLs permitted";
if (preg_match("/http:/i", "$firstName")) {echo "$SpamErrorMessage"; exit();}
if (preg_match("/http:/i", "$lastName")) {echo "$SpamErrorMessage"; exit();}
if (preg_match("/http:/i", "$emailAddr")) {echo "$SpamErrorMessage"; exit();}
if (preg_match("/http:/i", "$comments")) {echo "$SpamErrorMessage"; exit();}
if (mail($addrTo, $subject, $body) == false)
{
echo "The email was not sent, please try again later.";
}
//send the users email.
if (mail($addrTo, $subject, $body) == false)
{
echo "The email response was not sent. Please notify the webmaster.";
}
else
{
//echo the message on the web page.
echo "We look forward to contacting you soon!";
}
?>
[/php]