I have tried for quite some time to get the mail() function working using either my ISP's SMTP server or I also set one up on a windows 2000 box of my own. I have gotten several different error messages. At first i was getting the error message "sendmail_from not set in php.ini. this turned out to be that I had not restarted the web server after making the necessary changes to the PHP.ini file. Now I am getting the error message Warning: Failed to Receive in <the path to my scipt here> on line 3. I am able to send mail from outlook though both of my smtp servers. I have tried to make the script as basic as possible for my test.
<?PHP
mail('chadkinback@yahoo.com','this is the subject','this is the message.');
?>
I have even tried to set the PHP.ini values in the script.
<?PHP
ini_set("sendmail_from","ckinhack@autin.rr.com");
ini_set("SMTP","localhost");
mail('chadkinback@yahoo.com','this is the subject','this is the message.');
?>
Here is the INI file.
[mail function]
; For Win32 only.
SMTP = localhost
; For Win32 only.
sendmail_from = chadkinback@yahoo.com
I've seen that a few people out there had some initial trouble with this, but they were able to make it work by tweaking the ini file. I have not been so lucky.
Thanks.