-3

I need some help. It is all about the PHP mail function in ubuntu since when i accessing it through browser it returns false, but when i accessing it through command line it works. I am using postfix. Why is it? Thank You in advance.

<?php 
$res = mail ( "test@gmail.com", "Test from de lappie..." , "Hello World!" ); 
var_export( $res ); 
?>
  • when accessing it through browser. the browser displays "false",
  • when accessing it command line "php /var/www/adm/test.php" it works, i receive the mail.
rkevs21
  • 13
  • 5
  • Any codes?? What worked and how and what doesn't work ?? What command line you tried. – Mohit S Jul 30 '14 at 03:42
  • here is my code , test.php -> when accessing it through browser. the browser displays "false", when accessing it command line "php /var/www/adm/test.php" it works, i receive the mail. – rkevs21 Jul 30 '14 at 03:44
  • Plz update your question. its not easy to read here in comments. – Mohit S Jul 30 '14 at 03:45

1 Answers1

0

PHP has seperate ini files depending on the enviorment.

You need to make some changes to the configuration files

cli/php.ini
cgi/php.ini
php.ini

See here for the detailed information

Community
  • 1
  • 1
Avinash Babu
  • 6,171
  • 3
  • 21
  • 26