LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   How to send mail using PHP mail function On apache server (https://www.linuxquestions.org/questions/linux-server-73/how-to-send-mail-using-php-mail-function-on-apache-server-4175459941/)

kiran.ursal 04-29-2013 12:22 AM

How to send mail using PHP mail function On apache server
 
Hello,
I am using centos-6.2
Quote:

[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(
Quote:

php -r 'mail("K.u@gmail.com","hi","hello","r.u@gmail.com");'
)

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

TenTenths 04-29-2013 01:58 AM

Check your apache server and if it's doing other PHP functions correctly then check whatever PHP code you're using in your script.

j-ray 04-29-2013 03:21 AM

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.


All times are GMT -5. The time now is 12:43 AM.