

<?php
if (isset($_REQUEST['email']))
//if "email" is filled out, send email
  {
  //send email
  $email = $_REQUEST['email'] ;
  $subject = $_REQUEST['subject'] ;
  $message = $_REQUEST['message'] ;
  mail("$email", "$subject",
  $message, "From:" . $email);
  echo "Thank you for using our mail form";
  }
  
  
  
else 
//if "email" is not filled out, display the form
  {
 ?>
  <form method='post' action='simple_mail.php'>
  Email: <input name='email' type='text' value="email address" /><br />
  Subject: <input name='subject' type='text' value="subject goes here" /><br />
  Message:<br />
  <textarea name='message' rows='15' cols='40'> Type in your message
  </textarea><br />
  <input type='submit' />
  </form>
  
 <?php
  }
    
?>

</body>
</html>