I have a problem using the PHP mail function using a very simple form. I have been uploading the files to our webserver and the form works fine and redirects to the correct page, however, the test email I send never arrives. Can anyone help with this?

//This is the form send_mail.php
<form method="post" action="sendmail.php">
  Email: <input name="email" type="text" /><br />
  Message:<br />
  <textarea name="message" rows="15" cols="40">
  </textarea><br />
  <input type="submit" />
</form>
//This is the sendmail.php
<?php
  $email = $_REQUEST['email'] ;
  $message = $_REQUEST['message'] ;

  mail( "seanlubbe@gmail.com", "Feedback Form Results",
    $message, "From: $email" );
  header( "Location: http://www.lfmi.org/html/thanks.php" );
?>

I don't know what the problem was ...

This works

<?php
  $recipient = 'seanlubbe@gmail.com'; // used my email for testing ...
  $subject = 'Feedback Form Results';
  $message = $_REQUEST['message'];
  $headers .= 'From: '.$_REQUEST['email']."\r\n";

  mail( $recipient, $subject, $message, $headers ) 
    or die( "Failed to send email" );
  // should use
  // if ( $_REQUEST['email'] ) {
  // for this next line
  header( "Location: http://www.lfmi.org/html/thanks.php" );
?>
<html>
<head>
</head>
<body>
<form method="post" action="<? $_ENV['SELF'] ?>">
  Email: <input name="email" type="text" /><br />
  Message:<br />
  <textarea name="message" rows="15" cols="40"></textarea><br />
  <input type="submit" />
</form>
</body>
</html>

Hope it helps

This question has already been answered. Start a new discussion instead.