Why are you doing it that way? why not just use a simple form mail php script, its much easier.
Writing the Feedback Form
The first thing we need to do is to write the feedback form itself. Put the following code in the <body> section of an HTML file named, say, feedback.html.
<form method="post" action="sendmail.php">
Email: <input name="email" type="text" />
Message:
<textarea name="message" rows="15" cols="40">
</textarea>
<input type="submit" />
</form>
The Feedback Form PHP Script
Now all that remains is to code "sendmail.php". This is made extremely easy by the facilities available in PHP. Type the following code into a file named "sendmail.php". Do not put anything else into that file, ie, don't put in any other HTML tags or headers, etc.
<?php
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'] ;
mail( "
yourname@example.com", "Feedback Form Results",
$message, "From: $email" );
header( "Location:
http://www.example.com/thankyou.html" );
?>