Function mail() problem...

This is a discussion on Function mail() problem... within the PHP Language forums, part of the PHP Programming Forums category; Hello again. Mail() function in my php doesn't work. I've got very simple script: <? mail("bluszcz@...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-17-2005
Rafal Zawadzki
 
Posts: n/a
Default Function mail() problem...

Hello again.

Mail() function in my php doesn't work.

I've got very simple script:

<?
mail("bluszcz@jabberpl.org","Test","Test");
?>

My php.ini important lines are:

sendmail_path = /usr/sbin/poczta.sh
log_errors = On
error_log = /var/log/php.log
error_reporting = E_ALL


sendmail_path was earlier set to sendmail, but it doesn't work so i
tried to debug it.

error log works fine, but it doesn't show any error connected with mail
function.

/usr/sbin/poczta.sh is my script which contains:

#!/bin/bash
echo "mail() function was used" >>/tmp/php_MAIL.log


Anyone has got an idea?

Cheers,
--
Rafal Bluszcz Zawadzki
JabberPL.org SysAdmin
----------------------
Reply With Quote
  #2 (permalink)  
Old 05-17-2005
Alistair Baillie SS2002
 
Posts: n/a
Default Re: Function mail() problem...

does the script show an error?

If not the mail function is working.

Are you sure the address your sending it to, doesnt have spam filtering on,
and hasn't caught the mail as spam?

- Ali

"Rafal Zawadzki" <bluszcz@jabberpl.org> wrote in message
news:d6cm6m$1ls2$1@node2.news.atman.pl...
> Hello again.
>
> Mail() function in my php doesn't work.
>
> I've got very simple script:
>
> <?
> mail("bluszcz@jabberpl.org","Test","Test");
> ?>
>
> My php.ini important lines are:
>
> sendmail_path = /usr/sbin/poczta.sh
> log_errors = On
> error_log = /var/log/php.log
> error_reporting = E_ALL
>
>
> sendmail_path was earlier set to sendmail, but it doesn't work so i tried
> to debug it.
>
> error log works fine, but it doesn't show any error connected with mail
> function.
>
> /usr/sbin/poczta.sh is my script which contains:
>
> #!/bin/bash
> echo "mail() function was used" >>/tmp/php_MAIL.log
>
>
> Anyone has got an idea?
>
> Cheers,
> --
> Rafal Bluszcz Zawadzki
> JabberPL.org SysAdmin
> ----------------------



Reply With Quote
  #3 (permalink)  
Old 05-17-2005
Rafal Zawadzki
 
Posts: n/a
Default Re: Function mail() problem...

Alistair Baillie SS2002 napisa³(a):
> does the script show an error?
>
> If not the mail function is working.


This script doesn't create needed file.

> Are you sure the address your sending it to, doesnt have spam filtering on,
> and hasn't caught the mail as spam?


YES.

--
Rafal Bluszcz Zawadzki
JabberPL.org SysAdmin
----------------------
Reply With Quote
  #4 (permalink)  
Old 05-17-2005
Alistair Baillie SS2002
 
Posts: n/a
Default Re: Function mail() problem...

What do you mean, it doesnt create the required file?

The one line of code you gave, doesnt tell it to create a file?


"Rafal Zawadzki" <bluszcz@jabberpl.org> wrote in message
news:d6co23$1n4d$1@node2.news.atman.pl...
> Alistair Baillie SS2002 napisa³(a):
>> does the script show an error?
>>
>> If not the mail function is working.

>
> This script doesn't create needed file.
>
>> Are you sure the address your sending it to, doesnt have spam filtering
>> on, and hasn't caught the mail as spam?

>
> YES.
>
> --
> Rafal Bluszcz Zawadzki
> JabberPL.org SysAdmin
> ----------------------



Reply With Quote
  #5 (permalink)  
Old 05-17-2005
Alvaro G Vicario
 
Posts: n/a
Default Re: Function mail() problem...

*** Rafal Zawadzki wrote/escribió (Tue, 17 May 2005 14:01:32 +0200):
> sendmail_path = /usr/sbin/poczta.sh


> sendmail_path was earlier set to sendmail, but it doesn't work so i
> tried to debug it.


Does sendmail work from command line? Does PHP send mail if sendmail_path
not set? Does the postmaster user get the message returned?

> #!/bin/bash
> echo "mail() function was used" >>/tmp/php_MAIL.log


Does the script print the line? Does the script work from command line?
Does apache user have permission to write on /tmp/php_MAIL.log?


--
-- Álvaro G. Vicario - Burgos, Spain
-- http://bits.demogracia.com - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group
--
Reply With Quote
  #6 (permalink)  
Old 05-18-2005
Rafal Zawadzki
 
Posts: n/a
Default Re: Function mail() problem...

Alvaro G Vicario napisał(a):

> Does sendmail work from command line? Does PHP send mail if sendmail_path
> not set? Does the postmaster user get the message returned?


Yes, No, No.

>>#!/bin/bash
>>echo "mail() function was used" >>/tmp/php_MAIL.log

>
>
> Does the script print the line? Does the script work from command line?
> Does apache user have permission to write on /tmp/php_MAIL.log?


3*Yes.


--
Rafal Bluszcz Zawadzki
JabberPL.org SysAdmin
----------------------
Reply With Quote
  #7 (permalink)  
Old 05-18-2005
Alvaro G Vicario
 
Posts: n/a
Default Re: Function mail() problem...

*** Rafal Zawadzki wrote/escribió (Wed, 18 May 2005 10:05:10 +0200):
>> Does the script print the line? Does the script work from command line?
>> Does apache user have permission to write on /tmp/php_MAIL.log?

>
> 3*Yes.


I'd say that your sendmain clone doesn't not like the message then. Try the
following:

1) Check return value from mail() function
2) Provide a valid "From" address


--
-- Álvaro G. Vicario - Burgos, Spain
-- http://bits.demogracia.com - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group
--
Reply With Quote
  #8 (permalink)  
Old 05-18-2005
Rafal Zawadzki
 
Posts: n/a
Default Re: Function mail() problem...

Alvaro G Vicario napisał(a):
> *** Rafal Zawadzki wrote/escribió (Wed, 18 May 2005 10:05:10 +0200):
>
>>>Does the script print the line? Does the script work from command line?
>>>Does apache user have permission to write on /tmp/php_MAIL.log?

>>
>>3*Yes.

>
>
> I'd say that your sendmain clone doesn't not like the message then. Try the
> following:
>
> 1) Check return value from mail() function
> 2) Provide a valid "From" address


Wait, script print the line ONLY from command line.


--
Rafal Bluszcz Zawadzki
JabberPL.org SysAdmin
----------------------
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 11:45 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0