Help with mail() function
| From: | Pooya Eslami | Date: | Mon, 02 Feb 2004 20:42:05 +0000 |
| Subject: | Help with mail() function | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-176617@lists.php.net to get a copy of this message | ||
Hi, I'm new to php and this newsletter. I have a form on my webpage and a
php file to email it to me but the contents of the text area are not emailed
to me. Can anyone help me with this?
here is the code for my html and php files:
<html>
<head><title>Test</title></head>
<body>
<form action="textareamail.php" method="POST">
Comments: </br>
<textarea rows="10" cols="50" name="TextArea"></textarea>
</br>
<input type="reset" value="Clear">
<input type="submit" value="Submit">
</form>
</body>
</html>
<?php
if ($TextArea="") {
echo "You have to fill out the entire form,
go back and try again.";
} else {
$to = "me@myemailaddress.com";
$from = "From-Test";
$subject = "Subject-Test";
$message = "$TextArea";
mail($to, $subject, $message,"From: $from");
echo "Thankyou";
}
?>