Can you take a look at the code, and what i am doing to make sure I am doing this right.
I put this into the html box with html tags and all:
<form method="post" action="form.php">
Name:<input name="name" type="text" id="name"><br>
Email:<input name="email" type="text" id="email"><br>
Subject:<input name="subject" type="text" id="subject"><br>
Message:<textarea name="comments" id="textarea"></textarea><br>
<input type="submit" name="Submit" value="SUBMIT">
</form>
Then in another file i named it 'form.php' no html tags:
<?php
//Declare the variables
$recipient = " your e-mail here";
$message = "name: $name
email: $email
subject: $subject
message: $comments";
//Contents of form
$name=$_POST['name'];
$email=$_POST['email'];
$subject=$_POST['subject'];
$comments=$_POST['comments'];
//mail() function sends the mail
mail($recipient,$subject,$message);
//This line sends to thankyou page when finished
header("Location: thankyou.htm");
?>
Is that right? For some reason its not working. When i put it up on the internet it sends me to that thank you page, but the messages or anything does not come into my e-mail.
Thanks in advance.
|