Hi I am just starting out with PHP and run into an early problem. I referencing my code from Julie C. Meloni ALL in one book. The problem I have is that when i try to use send mail I receive an error message :Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\Program Files\Apache Group\Apache2\htdocs\sendmail.php on line 21" - Listed below is my sendmail.php and the part of my php.ini file that i was told to edit. The book had me rename the phprecommended.php to php.ini and copy that too the windows directory (not sure if this step is correct. I am use aim mail am I suppososed to put a password field in the code for authentication. I am running windows xp media edition, apache 2.0.52 and PHP 5.0.2. Thanks ahead of time your help is much appreciated.
Sendmail code:
<html>
<head>
<title> Sending mail from the an E-Mail Form</title>
</head>
<body>
<?php
echo "<p>Thank You, <b>$POST[name]</b>, for your message!</p>";
echo "<p>Your e-mail address is: </b>$POST[email]</b>.</p>";
echo "<p>Your message was:<br>";
echo "$POST[message] </p>";
//start building the mail string
$msg = "Name: $POST[name]\r\n";
$msg .= "E-Mail: $POST[email]\r\n";
$msg .= "Message: $POST[message]\r\n";
//set up the mail
$recipient = "myemailaddress@aim.com";
$subject = "Form Submission Results";
$mailheaders = "From: My Web Site <myemailaddress@aim.com> \r\n";
$mailheaders .= "Reply-To: $_POST[email]";
//send the mail
mail($recipient, $subject, $msg, $mailheaders);
?>
</body>
</html>
[
PHP.INI FILE:
[mail function]
; For Win32 only.
SMTP = smtp.aim.com
smtp_port = 25
; For Win32 only.
;sendmail_from = myemailaddress@aim.com
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
;sendmail_path =