Php – Sending mail from PHP with exim4

debianemaileximPHP

A web server I manage is having problems sending mail from PHP. This server uses exim4 for MTA, and it is configured correctly.

I can send emails from PHP's CLI, but not from the web. i.e. if I do "php mailtest.php" on the command line, the email gets sent correctly, but if I browse to server.com/mailtest.php, mail() returns false and the email never gets sent. Nothing appears in the exim mainlog.

Any advice, or things I should look for ?

Thanks!

Best Answer

It sounds like you've got different versions of php.ini located under /etc/php5/

debian:/etc/php5# find . | grep php.ini
./cli/php.ini
./apache2/php.ini

Check the [mail function] directive