View Single Post
Old 02-09-2011, 05:26 PM   #1
Join Date: Feb 2011
Posts: 7
Question Need help with Contact page (formmail.php)

Can someone tell me why this isnt working?
(click the red envelope icon)

2 things...

1. after info is entered it doesnt goto the thankyou.html page
2. the info is not sent to my email address.

Im sure the problem lies either within the formmail.php
I do not have the formmail.php in the right location...currently it is in the root folder of the website.

Here is the code within the formmail.php


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<META HTTP-EQUIV="refresh" content="0;URL=thankyou.html">
<title>Email Form</title>


// you can specify which email you want your contact form to be emailed to here

$toemail = "";
$subject = "From: Website";

$headers = "MIME-Version: 1.0\n"
."From: \"".$name."\" <".$email.">\n"
."Content-type: text/html; charset=iso-8859-1\n";

$body = "Name: ".$name."<br>\n"
."Email: ".$email."<br>\n"

if (!ereg("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$", $email))
echo "That is not a valid email address. Please return to the"
." previous page and try again.";

mail($toemail, $subject, $body, $headers);
echo "Thanks for submitting your comments";


thanks for any help
currysteph is offline   Reply With Quote