473,395 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

php, sendmail, works only from command line

hello all,

Ok, I have another instance of php only working from a command line (i
refer to an early post of mine).

I run a very simple script to send email:

<?php
print mail ('t***@anyemail.com',
'No need for reply -- PHP test!', /* subject */
"hi John\nLine 2\n"); /* body */
?>

I get a 1 message as a result, which means that the php worked, but I
get no email + no mail log entries...i.e. no trace of the email at
all.

If I run the php from the command line the email gets sent, delivered
and received fine to local users and non-local users.

Any suggestions?

Any help would be greatly appreciated.

sincerely

CoralineSage
Jul 17 '05 #1
3 2987
CoralineSage wrote:
Ok, I have another instance of php only working from a command line (i
refer to an early post of mine).
Do you mean news:9d**************************@posting.google.c om ?
I run a very simple script to send email:

<?php
print mail ('t***@anyemail.com',
'No need for reply -- PHP test!', /* subject */
"hi John\nLine 2\n"); /* body */
?>

I get a 1 message as a result, which means that the php worked, but I
get no email + no mail log entries...i.e. no trace of the email at
all.

If I run the php from the command line the email gets sent, delivered
and received fine to local users and non-local users.

Any suggestions?


Is the configuration for command line and web server php the same?

compare the browser result of phpinfo() with its command line version:
php -i
HTH
--
--= my mail box only accepts =--
--= Content-Type: text/plain =--
--= Size below 10001 bytes =--
Jul 17 '05 #2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

CoralineSage wrote:
If I run the php from the command line the email gets sent, delivered
and received fine to local users and non-local users.

Any suggestions?


Check with the server admin that the user the webserver is
running under is allowed to queue mail...
Bob

- --
| B. Johannessen <bo*@db.org> +47 97 15 20 09 - http://db.org/
| Mail & Spam - News, Drafts & Standards - http://db.org/blog/
| On The Origin Of Spam; Spam Statistics - http://db.org/spam/
- --
-----BEGIN PGP SIGNATURE-----

iD8DBQFANEZ9ooisUyMOFlgRAh+nAJ9pkF+y7+RpY2lp8KT5Bg SIO6pFRACgi7MA
Ou/8Tsx6yLRcCgEHc4SJv/o=
=s4sV
-----END PGP SIGNATURE-----
Jul 17 '05 #3
Guess what it was? I had to re-compile PHP at some point and it added
an extra "LoadModule php" directive in my httpd.conf and that was
causing the problem. Everytime I would restart the server it would
"warn" me that the module was already loaded so it would ignore the
instruction...I had planned to look into it to delete the extra line,
but since it said it was ignoring it I figure I could wait 'till
later.

Anyway, after I removed the extra loadmodule it worked great.

Thanks to both of you for replying! Your time is much appreciated.

Sincerely,
Chrys Li

"B. Johannessen" <bo*@db.org> wrote in message news:<1E******************@news2.e.nsc.no>...
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

CoralineSage wrote:
If I run the php from the command line the email gets sent, delivered
and received fine to local users and non-local users.

Any suggestions?


Check with the server admin that the user the webserver is
running under is allowed to queue mail...
Bob

- --
| B. Johannessen <bo*@db.org> +47 97 15 20 09 - http://db.org/
| Mail & Spam - News, Drafts & Standards - http://db.org/blog/
| On The Origin Of Spam; Spam Statistics - http://db.org/spam/
- --
-----BEGIN PGP SIGNATURE-----

iD8DBQFANEZ9ooisUyMOFlgRAh+nAJ9pkF+y7+RpY2lp8KT5Bg SIO6pFRACgi7MA
Ou/8Tsx6yLRcCgEHc4SJv/o=
=s4sV
-----END PGP SIGNATURE-----

Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: ratlhead | last post by:
Hi all, Because of a chroot jail a web site that I'm working on is in (I don't know much about the jail stuff), I can't use sendmail to send email through a PHP script. The sys admin said he's...
0
by: Wayno | last post by:
Hoping someone can help me out with this problem. First problem, is I am unable to view my php error log. In my php.ini I have my log in /var/www/logs/php_error_log. However, it has remained empty....
2
by: Babaloo | last post by:
Hello, I am having a problem with PHP 4.2.2 and RH 8. PHP is working fine except email. I have a test script to send mail, I have sendmail_path = '/usr/lib/sendmail -t -i' set in php.ini,...
0
by: Aaron Powell | last post by:
I am writing a program for a study I am doing where I must contact several different organisations stored in a database I compiled, but I need to send each email one at a time so they don't know...
3
by: Glen Wolinsky | last post by:
We have written a service that runs in the background to deliver email to our users. The emails are generated from data in SQL that our application creates. This service sends out thousands of...
3
by: swangdb | last post by:
I have a Sun Server running Solaris 10 and Sendmail 8.13.7. I have Majordomo and Listproc installed on this server and they work. I have several production majordomo and listproc mailing lists...
13
by: RJ_32 | last post by:
looking here: http://www.devarticles.com/c/a/PHP/Getting-Intimate-With-PHPs-Mail-Function/2/ it says that I have to be careful about what I send to the sendmail process via popen(). Does that...
3
by: digitaldiva | last post by:
Hi I am new here and once upon a time I worked with Perl, now I am trying again and need some help: I wrote a Perl script a few years ago that opened an order entry TXT file and sent each...
2
jhoborg
by: jhoborg | last post by:
Hello all, So I'm having trouble using sendmail in a CGI script as the topic title says. Here's what I'm trying to accomplish: User fills out a form, submits it, my CGI script receives this...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.