Sending mail from PHP with exim4

6,882

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

Share:
6,882
jfoucher
Author by

jfoucher

Updated on September 17, 2022

Comments

  • jfoucher
    jfoucher over 1 year

    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!

    • jgoldschrafe
      jgoldschrafe over 13 years
      What distro? Are you running in an SELinux-protected configuration?
    • jfoucher
      jfoucher over 13 years
      @jgoldschrafe Debian 5.0.6 and no.
    • Yasiru G
      Yasiru G about 6 years
      I'm facing the same issue. It seems like permission issue. Have you fix this issue?
  • jfoucher
    jfoucher over 13 years
    I did, they're the same in both files. I actually copied one to the other (and the other way around) and got the exact same results
  • DrDol
    DrDol over 13 years
    Do a phpinfo() and add the php server information "sendmail" to your question. Exim will normally replace the sendmail binary with the send compartible exim binary.