<form method="post" action="<?php echo($PHP_SELF) ?>">
<fieldset>
<legend>Email Form</legend>
<p><label>Name:</label><input type="text" name="name" id="name"></p>
<p><label>Email:</label><input type="text" name="email" id="email"></p>
<p><label>Comments:</label><input type="text" name="comments" id="comments"></p>
<p><input type="submit" name="submit" id="submit" value="Send Message"></p>
</fieldset>
</form>
<?php
# Add your email address
$to = '[email protected]';
# Add a default subject
$subject = 'You Have Mail From Your Website';
$loc = $_SERVER['PHP_SELF'];
$name = $_REQUEST['name'];
$email = $_REQUEST['email'];
$comments = $_REQUEST['comments'];
$submit = $_REQUEST['submit'];
$body = "You have received an email from $name \n ($email) \n \n $name wanted to tell you: $comments \n \n He sent this message from $loc";
if(isset($submit)) {
mail($to, $subject, $body);}
?>