On Wed, 2004-07-28 at 10:13, kengaun wrote: > I have the following php code > > <?php > > mail("[EMAIL PROTECTED]", "My Subject", "Line 1\nLine 2\nLine > 3"); > > echo "mail send ?"; > > ?> > > I got the following error code:- > [28-Jul-2004 16:57:14] PHP Warning: mail() [<a > href='function.mail'>function.mail</a>]: "sendmail_from" not set > in php.ini or custom "From:" header missing in > D:\OFI\mail_test2.php on line 3 > > I am running using IIS, php5b4 > > Please help to advise what need to install and modify the ini file ? >
I'll try, though I do not use PHP on MS Windows (note the get-out clause)... In php.ini are 3 settings to do with sending email. The sendmail_path is for unix only so you may ignore it. The sendmail_from is for MS Windows only so you need to set this to the email address that the email you are sending is going to appear to be sent from (e.g. [EMAIL PROTECTED]). This should be a real address as replies are likely to be sent to it. The third item is SMTP and is for MS Windows so you need to set this also. This defaults to "localhost" which assumes that you have a MTA listenning on port 25 on the computer on which you are running PHP. This often is not the case and you can set it to any smtp server that will relay email for you. If you were at home and using a normal ISP for internet access then you would probably set this to your ISPs outgoing email server. The smtp server that you set this to must relay email for you, you cannot just set it to any smtp server. I don't know the usual location of php.ini under MS Windows but I think it is commonly c:\windows or c:\winnt. If you put a file called phpinfo.php containing just "<?php phpinfo(); ?>" (without the quotes) in your document root and look at that, it will tell you where it is expecting php.ini to be located. Sample php.ini files are often sent out called php.ini-recommended or php.ini-dist which you will need to rename and put into the correct directory. I notice you say you are using a beta version of PHP, perhaps you should consider upgrading to a stable release? Hope this helps Regards Chris