By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,404 Members | 1,705 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,404 IT Pros & Developers. It's quick & easy.

Function mail() problem...

P: n/a
Hello again.

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

I've got very simple script:

<?
mail("bl*****@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
----------------------
Jul 17 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
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" <bl*****@jabberpl.org> wrote in message
news:d6***********@node2.news.atman.pl...
Hello again.

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

I've got very simple script:

<?
mail("bl*****@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
----------------------

Jul 17 '05 #2

P: n/a
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
----------------------
Jul 17 '05 #3

P: n/a
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" <bl*****@jabberpl.org> wrote in message
news:d6***********@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
----------------------

Jul 17 '05 #4

P: n/a
*** 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
--
Jul 17 '05 #5

P: n/a
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
----------------------
Jul 17 '05 #6

P: n/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
--
-- Á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
--
Jul 17 '05 #7

P: n/a
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
----------------------
Jul 17 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.