Click to See Complete Forum and Search --> : mail() function problems


Anon
02-06-2001, 02:16 PM
I've recently upgraded to php4.0.4pl1 and the mail function does not seem to work. I believe sendmail is setup correctly, but i don't get any error messages, the mail just doesn't send. I've tried many things and know it is not my code. Any help as to where to start tracking down the problem would be greatly appreciated!

edwardsbc
02-06-2001, 02:50 PM
How about some more information, like OS, Web server, and a copy of your test script. (You did build a simple script to test the mail() function didn't you?).

I would also try utilizing send mail from another source program (like a unix mail command).

You mentioned you upgraded. By chance, did you overwrite your old php.ini file? Perhaps the old ini file had the "correct" settings for your particular mail setup. What version of php did you upgrade from?

Anon
02-06-2001, 03:21 PM
ok sorry bout that, i'm running mandrake 7.2, apache, and sendmail 8.11( believe). I've had no other problems sendmail using it for smtp(through email clients). I'm not sure of the exact unix commands to to from the command line, so if you could give me that i'll try it. I upgraded my whole server including sendmail, apache, php, mysql...everything, so there is no record of previous files. Here is my test script(i've tried quite a few - some that worked fine before the upgrade and now don't, but here goes)
-----------------------
<?php
if (mail('robbie@wireco.net', 'testing', 'test test test', 'From:test@test.com')){
echo("Worked");
} else {
echo("did not work");
}
?>
-----------------------

I always get 'did not work' and i've tried quite a few differnet variation on the mail function. Thanks for the help!

-robbie

Anon
02-06-2001, 03:51 PM
here's some more info, my php.ini points sendmail_path to /usr/sbin/sendmail -t which there is a sendmail command there. But it still won't work. Sendmail works fine using pine.

Anon
02-06-2001, 03:57 PM
sorry so many messages, but if it would help at all info page is at

http://www.designpipe.com/phpinfo.php

edwardsbc
02-06-2001, 04:33 PM
These are the differences I can see between my setup and yours:

1) In sendmail_path I do NOT set the "-i" flag, as yours does.

2) In sendmail_from I have a legitimate email address, you have no value. It is possible sendmail or php is unhappy about this. I can't be certain though, I know next to nothing about sendmail.

I'll turn this over in my head for a while and perhaps try a couple of experiments. I'll let you know if I turn anything up.

Anon
02-06-2001, 05:34 PM
thanks, i tried changing those settings and it still does not work. The sendmail_from address has a comment in php.ini saying thats for win32 only. Let me know if you think of anything else.