Go Job Hunting at the LQ Job Marketplace
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 04-29-2013, 12:22 AM   #1
Registered: Feb 2012
Posts: 36

Rep: Reputation: Disabled
Wink How to send mail using PHP mail function On apache server

I am using centos-6.2
[root@localhost sbin]# uname -a
'Linux localhost.localdomain 2.6.32-220.el6.i686 #1 SMP Tue Dec 6 16:15:40 GMT 2011 i686 i686 i386 GNU/Linux
I have apache server,php5 on my system and I want to send mail using sendmail on my system.
when I try to send mail from shell that time mail is succesfully sent to respective address(
php -r 'mail("","hi","hello","");'

but when I try to send it through webbrowser I am not able to send it.
so please help me if anybuddy knows the solution on this problem
Old 04-29-2013, 01:58 AM   #2
Senior Member
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6
Posts: 1,839

Rep: Reputation: 600Reputation: 600Reputation: 600Reputation: 600Reputation: 600Reputation: 600
Check your apache server and if it's doing other PHP functions correctly then check whatever PHP code you're using in your script.
Old 04-29-2013, 03:21 AM   #3
Senior Member
Registered: Jan 2002
Location: germany
Distribution: ubuntu
Posts: 1,502

Rep: Reputation: 121Reputation: 121
maybe the webuser (wwwrun, nobody or such) is not allowed to use sendmail functionality? Check permissions.
Could be helpful to take a look at apache error logs. Maybe you can find a hint in there.

Last edited by j-ray; 04-29-2013 at 03:25 AM.


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
Want to send mail with php mail() command - minimum config required? FeathersMc Linux - Server 2 10-26-2008 12:21 AM
Do i need to configure anything in Apache to let php to send mail shailesh_mishra Linux - Server 1 01-19-2007 02:24 AM
Help needed to send mail using a remote smtp server with php s1mpl1c1ty Programming 4 09-19-2005 12:53 AM
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

All times are GMT -5. The time now is 01:32 PM.

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