Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 11-30-2006, 07:46 AM   #1
Registered: Sep 2005
Location: kannur
Posts: 59

Rep: Reputation: 15
php mail() not working


i have a problem with php mail() function

i use fedora core 4 machine with

php-5.0.4-10 and sendmail-8.13.4-2

and sendmail is running and php mail() function return true but the mail is not getting to my mailbox.

awaiting for reply.....
Old 11-30-2006, 08:44 AM   #2
Registered: Nov 2003
Location: Macungie, PA
Distribution: Fedora Core 9, Gentoo 2008.0
Posts: 108

Rep: Reputation: 15
You may want to check your sendmail settings just to be sure.

However, I have found that utilizing the mail method in PHP "as is" isn't such a great thing. I recommend, instead, that you check out the PHPMailer project (located at When I was experiencing sendmail and SMTP-based mail sending problems (I was switching between the two based on the requirement specs I was given) PHPMailer "magically" took care of all of them for me.

See if this helps.
If not, I don't think I can really offer much else.


Last edited by revof11; 11-30-2006 at 09:00 AM.
Old 11-30-2006, 10:54 AM   #3
Registered: Sep 2006
Posts: 248

Rep: Reputation: 30
sajith.. My question is where is you mailbox? On localhost? Or on a remote server?
It can happen that you are not able to send messages from servers that are not trusted or do not match the requirements of the receiving server. Eg: no domain set up, no MX record in DNS etc...
If it is not working on you local network than there is no chance to send mails to the outer world. Try to send a mail to yourself using telnet and SMTP. Use mail command in CLI and see what happens. If it works the next step might be making sure that your PHP is properly configured.
Sendmail is an awesome program but it is not that easy to configure. Did you use a package or did you compile the programs. Compiling the programs can grant you extra security but on mostly every system now you can use packages to install these programs that are preferred because you will find extra support for them.
You also might want to consider using a MTA that is less complicated to configure. Postfix is one of them. Actually this is a sendmail alternate and works perfect with PHP3-5. (^_^)
I love it.
I found a good link for you how to set it up and configure on archlinux but no worries. It will work almost the same way for Fedora and Ubuntu too.

PHP.ini is a critical config file. I don't know what should you do but I am sure that you need to make sure that these two lines are properly configured:
sendmail_path = /usr/sbin/sendmail -t
sendmail_from =


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP mail() function not working with Exim Madone_SL_5.5 Programming 6 12-03-2006 09:05 PM
php mail() function not working as it should on my box juancha Linux - Newbie 14 02-16-2006 12:43 PM
PHP Website with e-mail forms, what mail daemon? gbkyle Linux - Software 1 07-05-2005 12:33 PM
Cannot send mail with mail() command in PHP 4.3.4, Apache 2.0.48, Mandrake Linux 10 arcanum Linux - General 3 06-27-2004 06:06 PM
send mail via PHP from website on apache. not working mdkelly069 Linux - Software 0 02-25-2004 12:15 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:26 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration