Why is my PHP mail function not working?
I'm calling PHP's mail(), but it's not working. What should I do?
1 Reply
To troubleshoot this, a good first step would be to enable error logging for PHP. To do this, you can put these function calls before the call to the mail() function that you're making:
ini_set('display_errors', 1);
error_reporting(E_ALL);
Then, review the logs that are produced for more clues. Your PHP might also have a separate mail log set up (like /var/log/phpmail.log). This can be specified in your php.ini file under the mail.log option. You can find where your php.ini file with these steps: