Click to See Complete Forum and Search --> : Sendmail


michaelmwilson
09-05-2002, 01:29 PM
When using :

<?
$to="michaelmwilson1@aol.com";
$subject="hello";
$message="message body";


if (@mail($to,$subject,$message)){
echo "mail was sent";
}
else {
echo "mail was not sent";
}

?>

The script executes and says "mail was sent". When i check, i get no e-mail.
OS=freebsd 4.4
mailprog=sendmail.
I cannot figure out why, and cannot find any mail error messages or dead letters. Can anyone point me in the right direction to finding help?

Thanks in advance
Mike

bealers
09-05-2002, 01:42 PM
on the command line try

echo "test body" | mail -s "test subject" foo@bar.com

do you get the email?

michaelmwilson
09-09-2002, 01:37 PM
yes i did get mail when using that code!
I have posted the server side error messages from /var/log/maillog associated with sending mail using php/web. Any help again is greatly appreciated!


sendmail[17015]: LAA17015: from=nobody, size=40, class=0, pri=40, nrcpts=0, msgid=<200209091509.LAA17015@michaelmwilson.com>, relay=nobody@localhost

sendmail[17015]: LAA17015: LAB17015: DSN: nobody... Recipient names must be specified

mail.local: setreuid(0, 0): Operation not permitted (r=65534, e=65534)

sendmail[17018]: LAB17015: to=root, delay=00:00:00, xdelay=00:00:00, mailer=local, stat=Service unavailable

sendmail[17018]: LAB17015: LAA17018: return to sender: Service unavailable

sendmail[17018]: Losing qfLAB17015: savemail panic

sendmail[17018]: LAB17015: SYSERR(nobody): savemail: cannot save rejected email anywhere: Permission denied

mail.local: setreuid(0, 0): Operation not permitted (r=65534, e=65534)

sendmail[17021]: LAA17018: to=root, delay=00:00:00, xdelay=00:00:00, mailer=local, stat=Service unavailable

dotwebbie
09-10-2002, 09:24 PM
If I read that correctly (which I may not have since I am half awake and have a pounding headache . . .), you tried to send the mail to multiple recipients, yes?

michaelmwilson
09-11-2002, 10:56 AM
No, i'm only trying to send to one recipient. I'm examining some issues though. First: How does the $send_to variable have to be formatted? Is it "To: foo@bar.com" or just "foo@bar.com". Second: Why is the setreuid operation not allowed? I think if i can find the answers to these two questions, my problem is sovled.
Thanks again everyone
~~Mike

dotwebbie
09-11-2002, 11:11 AM
$send_to should not need the To:. Something that is just bugging me, perhaps it's just the setup of your system but why is the mail relaying off of
nobody@localhost? I'm not exactly familiar with *BSD so perhaps I'm barking up the wrong tree . . . Also, why is it complaining that no recipients were specified?

KoshNaranek
09-13-2002, 05:45 AM
i'm a little confused..

isn't a @ in front of a command "dont check execution/returncodes - don't prompt any errors" ?

dotwebbie
09-13-2002, 11:23 AM
The @ suppresses php errors and let's you use custom errors.

Wave
09-13-2002, 11:44 AM
afaik, simple solution of this problem described at php.net in user contributed notes for mail() function.