FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » General » PHP discussions » Help! mail() isn't working...
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
icon9.gif  Help! mail() isn't working... [message #7335] Mon, 18 November 2002 18:36 Go to next message
Olliver   Germany
Messages: 443
Registered: March 2002
Karma: 0
Senior Member
Sorry for this title, but I'm really getting desperate here. I try to verify a contact mailer script but it fails to send any mails. Output claims:
Quote:

Warning: mail() is not supported in this PHP build in /home/httpd/www-root/mambo/emailfriend/emailarticle.php on line 139

The only thing the script is doing is using mail(), nothing more. PHP version is 4.24-dev (stable branch) running as module on apache 1.3.27. There are no explicit compile options for using mail functionality nor am I aware of configuration errors in my php.ini.
Any help would be greatly appreciated.
bye
Olliver

[Updated on: Mon, 18 November 2002 18:37]

Report message to a moderator

Re: Help! mail() isn't working... [message #7337 is a reply to message #7335] Mon, 18 November 2002 18:43 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
PHP's mail() function is dependant on sendmail being detected during install. If no sendmail binary (or symlink to equivalent utility, qmail for example) is found mail() will NOT be avaliable.

FUDforum Core Developer
Re: Help! mail() isn't working... [message #7339 is a reply to message #7337] Mon, 18 November 2002 19:05 Go to previous messageGo to next message
Olliver   Germany
Messages: 443
Registered: March 2002
Karma: 0
Senior Member
hm. that's strange, because before I recompiled php I did install sendmail. This is the reason why I can't understand it. I'll recompile php and hope it will detect it this time. Thanks for ur reply anyway, now I know at least that sendmail is actually needed Wink.
bye
Olliver
Re: Help! mail() isn't working... [message #7342 is a reply to message #7339] Mon, 18 November 2002 21:19 Go to previous messageGo to next message
Olliver   Germany
Messages: 443
Registered: March 2002
Karma: 0
Senior Member
I don't know what is wrong here. It's still not working. sendmail is at /usr/sbin/sendmail and will be started with -t -i in the php.ini. Should work even though I'm not running it as a daemon. I looked for a solution using google but the advices I found weren't useful. One said php has to be compiled with sendmail on the system. Then there was another advice which claimed that it would work if the spool dir is explicitly set. Tried it but without any effects as well Sad.
Anyone having an idea?

Olliver
Re: Help! mail() isn't working... [message #7343 is a reply to message #7342] Mon, 18 November 2002 21:28 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
what does: function_exists("mail") return?
I suspect it returns false, meaning that the mail() function is not avaliable. When you ran ./configure of PHP, was sendmail in the PATH, it was not it probably explains why you don't have mail() function.


FUDforum Core Developer
Re: Help! mail() isn't working... [message #7347 is a reply to message #7343] Mon, 18 November 2002 22:28 Go to previous messageGo to next message
Olliver   Germany
Messages: 443
Registered: March 2002
Karma: 0
Senior Member
Hi,
I made the following test:
<?PHP if(function_exists("mail")) echo "it's there"; ?>

It keeps claiming it would be there. Speaking of paths: I compiled PHP as unpriviliged user. since the path is in /usr/sbin/ it's not available for me but for all other users with root privileges. Could this be the reason? Hm, although I hate compiling as root I should try it to see if something changes.
bye
Olliver
Re: Help! mail() isn't working... [message #7348 is a reply to message #7347] Mon, 18 November 2002 22:36 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
You can just add /usr/bin to your $PATH enviroment variable that should be enough.

If the function mail() is avaliable you should be able to use it...


FUDforum Core Developer
Re: Help! mail() isn't working... [message #7349 is a reply to message #7347] Mon, 18 November 2002 22:38 Go to previous message
Olliver   Germany
Messages: 443
Registered: March 2002
Karma: 0
Senior Member
Hi Ilia,
Ur hint was right. Compiling as root, the script finally detects sendmail. So although it's not finished yet I can say that the problem is solved now. Thank u for ur help, u saved the rest of my day Smile Smile
bye
Olliver
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: mail() vulnerability up to php 4.2.2
Next Topic: strange session problem
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 21 14:31:57 GMT 2024

Total time taken to generate the page: 0.02622 seconds