mail() function not working

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Jim_cliff11
Forum Newbie
Posts: 7
Joined: Mon Nov 03, 2003 7:05 am

mail() function not working

Post by Jim_cliff11 »

Hi all i have a very big problem with the function mail()

If you try signing upto http://www.briskfire.com/newsite/join_form.html
It says the email has been sent but you never get it.

Ive tried changing the setup of mail function in php.ini in my
/usr/local/lib/ directory. Ive set it to my sendmail binary:-
/usr/sbin/sendmail -t -i but still nothing. Ive tried it without the -t -i variables and it dont work. The code is definatly right but its just not working. Ive tried setting the SMTP options and ive set my from address, but still nothing, its really starting to annoy me. Could it be something to do with apache running as a normal users - should i set it to run as root?

Anyhelp would be greatly appriciated
thanks
qads
DevNet Resident
Posts: 1199
Joined: Tue Apr 23, 2002 10:02 am
Location: Brisbane

Post by qads »

would't hurt to post the code.
User avatar
Johnm
Forum Contributor
Posts: 344
Joined: Mon May 13, 2002 12:05 pm
Location: Michigan, USA
Contact:

Post by Johnm »

Apache should run under it's own user NOT as root. Creat a user called webserver or something like it for Apache to run as and adjust permissions as needed.


John M
Jim_cliff11
Forum Newbie
Posts: 7
Joined: Mon Nov 03, 2003 7:05 am

Post by Jim_cliff11 »

This is the code:-

mail($email_address, $subject, $message,
"From: MyDomain Webmaster<admin@mydomain.com>\n
X-Mailer: PHP/" . phpversion());


BUT thats not the problem ive tried even he simplest mail() functions and it sill dosnt work. Its DEFINATLY an error with the mail server or something in my php.ini. So if any one can solve this problem for me i would be greatful. Thanks
Post Reply