0

I am also having problems in mail(). My php.ini values are (sendmail_from:"no value", SMTP:"localhost", smtp_port:"25"), my code is very simple and is as below -

<html>
<body>

<?php
if (isset($_REQUEST['email'])) 
  {
  //send email
  $email = $_REQUEST['email'] ; 
  $subject = $_REQUEST['subject'] ;
  $message = $_REQUEST['message'] ;
  if (mail( "kathie_hkg@yahoo.com", "Subject: $subject", $message, "From: $email" )) {
		echo("<p>Message successfully sent!</p>");
	} else {
		echo("<p>Message delivery failed...</p>");
	}
} else {
  echo "<form method='post' action='mailform.php'>
  Email: <input name='email' type='text' /><br />
  Subject: <input name='subject' type='text' /><br />
  Message:<br />
  <textarea name='message' rows='15' cols='40'>
  </textarea><br />
  <input type='submit' />
  </form>";
  }
?>

</body>
</html>

It always gives me "Message delivery failed...". Pls help. Thanks.

4
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by network18
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.