|
Posted by J.O. Aho on 05/14/06 12:45
fjab wrote:
> On Sun, 14 May 2006 09:31:07 +0200, J.O. Aho wrote:
>
>> fjab wrote:
>>> When executing a php script for sending an e-mail it works just fine from
>>> command line. When I try to execute that same script from within a browser
>>> an error occurs: mail problem.
>>> Anyone knows what to do about this?
>> It's difficult to say, as we don't know what way you send e-mails in your php
>> script, we don't know what MTA you have installed, we don't know if you have
>> your MTA service running or not, we don't know if you have messed up the
>> default settings in your php.ini that you use for your web server compared
>> with the php.ini that is used for cli.
>>
>> So there can be many causes and as many how to fix it.
>>
>>
>> //Aho
>
> Thanks for answering so quick.
> I will try to answer the questions.
>
> 1. MTA
> It works fine from command line, so the MTA is running and working. I
> don't think this has anything to do with the problem.
Say your MTA is sendmail and you use it directly from command line, then it
will work, but not with php if you don't have the service up and running.
> 2. The script
> <?php
> if(!mail("testuser@domain.nl","test","message","From:
> Testuser<testuser@domain.nl>\r\n")) exit("Mail error");
> else echo "Message send";
> ?>
The last \r\n is always added on the mail header part, so you can skip that part.
> 3. The php.ini
> It is a fresh install of FC5, nothing changed, all standard files nothing
> messed up
Okey, should work, if the service is up and running, check with chkconfig to
see if you have MTA service running, think sendmail ain't the default in
RedHat anymore.
//Aho
Navigation:
[Reply to this message]
|