mail function

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
BarryS
Forum Newbie
Posts: 9
Joined: Fri Oct 18, 2002 4:13 am
Location: London

mail function

Post by BarryS »

I am new to php and have not had the mail () function to work. Using RH7.3 the mail appears to go to /var/spool/mail/root.

Php info environment also says mail goes to the same local address. How do I make it work with smtp/sendmail?

Any help will be appreciated.
DeGauss
Forum Contributor
Posts: 105
Joined: Tue Oct 22, 2002 9:44 am
Location: Gainesville, FL

Post by DeGauss »

What's the sendmail line in your php.ini file look like?

I'm assuming it's still php.ini on nix boxes...
BarryS
Forum Newbie
Posts: 9
Joined: Fri Oct 18, 2002 4:13 am
Location: London

Post by BarryS »

My php.ini says:

[mail function]
; For Win32 only.
SMTP = localhost

; For Win32 only.
sendmail_from = me@localhost.com

; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
sendmail_path = /usr/lib/sendmail

There are no more references to sendmail

Still lost, thanks for your input
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

can you send mails to local/remote accounts in a shell via mail-command?
man mail for syntax and options. maybe your sendmail/qmailisn't configured by now.

Setting Up sendmail in RedHat Linux 7.1
BarryS
Forum Newbie
Posts: 9
Joined: Fri Oct 18, 2002 4:13 am
Location: London

Post by BarryS »

Many thanks for your help. I could not send them, but now I can send from the terminal and users can as well. I still cannot send from the php mail() function.

I am not sure the core is correct in phpinfo() I have
sendmail_from bloggs@bloggy.net

path /usr/lib/sendmail
(this is the correct path to sendmail)

SMTP localhost

Mail /var/spool/mail/root

Any ideas: Maybe the php.ini, what would the php.ini usually say?
BarryS
Forum Newbie
Posts: 9
Joined: Fri Oct 18, 2002 4:13 am
Location: London

Post by BarryS »

Found the last problem. I failed to delete the [Mail] windows references in the php.ini.

Maybe, other's have done the same thing as the associated comments did not mention it.

Thanks for the help everyone.
Post Reply