PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
The code below used to work under PHP 4.0 and that we upgrade to PHP 5, it' no longer working. Will anyone suggest where the problem is and how to fix it?
Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in F:\wwwroot\home\alumni\updateSuccess.php on line 264
Thank you for the response. Where do I change the php.ini file and usuasly where is that file located? I'm not the web server administrator. Is this something the web server administrator has to do?
Windows Servers require having several smtp settings set in the php.ini typically.. The ini is located somewhere in the system paths. Use phpinfo() to determin where the current php.ini is being loaded from.
Glad to hear that. So how do I set it, where on the file, and which file do I set it? This is the location, http://www.uwstout.edu/foundation/phpinfo.php. It showed me a bunch of information. I'm not sure what to look for.
provided you have access rights to that place on the server, and you can restart your web server, you can change them in that file.. however, if you want to change them via the script, then running ini_set() with the appropriate arguments, as detailed on that page, will yield much the same results..
Well, that's what I'm afraid you're going to say. I saw this line Configuration File (php.ini) Path E:/php/php.ini too but I don't have rights or permission to that file.
So if I'm going to ask the administrator to do so, what do I need to tell me to do?
Many thanks for the response. Since I have no permission to edit the php.ini file and we don't want to set mails sent via PHP from just one particular email address, I was told to use this line ini_set('sendmail_from','you@yourdomain.com'); before the mail() function was called. I have no errors by using this method but I did not receive the email. Any idea why?
there are many factors to not recieving an email.. were you expecting the email to show at the address you specified in the sendmail_from setting? It won't get sent there unless you tell the mail function to copy that address in some fashion: to, cc, or bcc.
Many thanks for all your support. I got it working now. I specified a different address in the $to variable and that is why I didn't receive any emails. It's working now.
Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in c:\Inetpub\wwwroot\WebWorks\demo\pre_demo.php on line 662
The only thing that i did was to upgrade from PHP 4.3.10 to 5.0.3 by replacing the necessary .dll files. I have tried changing the php.ini file (just in case there is a difference betweent the two versions), but the only thing that gets it to work is by calling the php4ts.dll in IIS. Once I point it to the php5ts.dll it quits working again.