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@...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 ---------------------- |
|
|||
|
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 > ---------------------- |
|
|||
|
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 ---------------------- |
|
|||
|
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 > ---------------------- |
|
|||
|
*** 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 -- |
|
|||
|
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 ---------------------- |
|
|||
|
*** 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 -- |
|
|||
|
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 ---------------------- |