Mail returns false

前端 未结 7 1314
太阳男子
太阳男子 2020-11-30 13:43

I\'m currently using a custom made library at my job. Until just rencently the library was working perfectly. It apparently return false since about today.

The libra

7条回答
  •  臣服心动
    2020-11-30 14:28

    I just had the same problem. After a php upgrade, the mail function always returns false.

    I used this little snippet to check it out:

    Result was: ' . ( $result === FALSE ? 'FALSE' : 'TRUE') . $result;
    echo '
    '; echo phpinfo();

    The solution was setting a value in my php.ini for 'sendmail_from' and 'sendmail_path'. The correct values in my case were:

    sendmail_from = "no-reply@mydomain.net"
    sendmail_path = "/usr/sbin/sendmail -t -i"
    

    (I'm using CentOS 5.3 w/ Zend Server CE.)

    You could use ini_set() to set the value of 'sendmail_from', but the 'sendmail_path' var must be setup in your php.ini or http.conf.

    • http://us3.php.net/manual/en/configuration.changes.modes.php
    • http://us3.php.net/manual/en/ini.list.php

提交回复
热议问题