Hi Everyone,

I'm having what is probably a simple problem with a form submission script. Here's how it's supposed to work...

The user fills out the form, clicks on submit, the form data gets sent via email to me, and the user gets redirected to a page that says "it worked".

I have a simple form at http://thenightowl.com/html-test/test-form-only.html (this is just the form, no input validation, etc)

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
    <form name="request" id="request" method="post" action="test-form-only-email.php" style="margin: 0px 0px 0px 15px">
        <div style="width: 420px">
            <div class="formLeft">Name:</div>
            <div class="formRight"><input type="text" name="name" id="name" style="width: 320px" /></div>
            <div class="formLeft">Email:</div>
            <div class="formRight"><input type="text" name="email" id="email" style="width: 320px" /></div>
            <div class="formLeft">Phone:</div>
            <div class="formRight"><input type="text" name="phone" id="phone" style="width: 320px" /></div>
            <div class="formLeft">Questions or Comments:</div>
            <div class="formRight"><textarea name="comments" id="comments" cols="1" rows="5" style="width: 320px"></textarea></div>
        </div>
        <br />              
        <input type="submit" value="Submit" name="submit" style="margin: 6px 0 10px 0" />
    </form>
</body>
</html>
It calls "test-form-only-email.php" (a stripped down script)

Code:
<?PHP  putenv("TZ=US/Central"); $time = date("M j, Y, g:i a");

$name = $_POST["name"];
$phone = $_POST["phone"];
$email = $_POST["email"];
$comments = $_POST["comments"];

$recipient = "stevemtno@gmail.com";
$subject = "test form only - short form";

$body = "<p><b>Name:</b> $name<p><b>Phone:</b> $phone<p><b>Email:</b> $email<b>Comments:</b> $comments";

//$headers = "From: \"$fname " . "" . "$lname \" <$email>\r\n";

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

$send = mail($recipient,$subject,$body,$headers);

header( "Location: http://thenightowl.com/html-test/it-worked.html" ) ;

?>
If the script runs, it will redirect to http://thenightowl.com/html-test/it-worked.html

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
it worked
</body>
</html>
I've tested everything repeatedly. It calls the script and redirects after the submit, but it isn't creating the email.

If anyone can help with this, it would be greatly appreciated.. thanks!

Steve