PDA

View Full Version : mail function in PHP


leanuisine
06-28-2002, 05:30 PM
Hi

Since this is my first posting I'd like ot start by saying that this site is great!!! It has helped me to "a fullfilling life with my OSX" as one might have me say in a testimonial advertisment... Well the pleasantries aside, my problem:

I am having trouble using the mail function in PHP, it simply doesn't send any mails. Does anyone know if one has to customize something in Apache or PHP to make it work. What should i do to get this to work?

mervTormel
06-28-2002, 06:11 PM
after you attempt to mail via PHP (?) could you then immediately examine the log
files to see if there are any illuminating messages ?

% ls -lo /var/log/{mail,system}.log
-rw-r----- 1 root 52361 Jun 28 13:00 /var/log/mail.log
-rw-r----- 1 root 12021 Jun 28 15:05 /var/log/system.log

% tail -20 !*

% tail -20 /var/log/{mail,system}.log
...

leanuisine
06-28-2002, 06:25 PM
Hi! thanks for replying... I tried typing the command you quoted like this
[localhost:~] leancuisine% ls -lo /var/log/{mail,system} .log
and got this message:
ls: .log: No such file or directory
but i found a file called mail.log in the directory /var/log/ and the last entry in that file was like this:

Jun 28 23:04:01 localhost sendmail[415]: unable to qualify my own domain name (localhost) -- using short name
Jun 28 23:04:01 localhost sendmail[415]: NOQUEUE: SYSERR(www): /etc/mail/sendmail.cf: line 81: fileclass: cannot open /etc/mail/local-host-names: Group writable directory
Jun 28 23:04:01 localhost sendmail[415]: gethostbyaddr(192.168.0.117) failed: 1

Maybe that's something that could give provide a clue... Obviously I should either provide a hostname in some configuration file or somehow change write permissions... hmm...

mervTormel
06-28-2002, 06:46 PM
no space in the file spec i submitted...

ls -lo /var/log/{mail,system}.log

your command arg has a space in it...

ls -lo /var/log/{mail,system} .log

very different.


one quick possible solution to get you further along...

% sudo chmod g-w /

will allow sendmail to run without squawking about group writable dir

you can search the forums and the main site for much info about sendmail.

leanuisine
06-28-2002, 07:12 PM
you were quite right about the space...

There seems to be some kind of instructions on how to configure sendmail in the README file in the sendmail directory... I guess i will have to dive into reading that and I will also follow you advice about looking further around here...

At least now I got something to "work with" in trying to find out how to set up my environment... thanks again :)