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.