I'm trying to get some mail problems fixed on a Windows 2008 server with IIS. I added a setting to the PHP.ini file to specify a mail log:

mail.log="C:\Windows\temp\php-mail-errors.log"

However that file contains nothing at all when I try to send mail and it either succeeds or fails. I'm wondering if it's a permission issue or something else?

Any tips would be most welcome.

    Couple of questions...

    1. Which version of PHP are you using?

    2. Does a phpinfo() confirm your new value for the mail.log directive?

    3. Have you tried restarting IIS?

      1) PHP 5.2.14. I now see that the mail.log directive is only available since php 5.3
      2) It does not take the mail.log directive, but other directives that I change (such as SMTP or smtp_port) do change so I know I'm editing the right ini file.
      3) Yes, repeatedly.

      Given that it' s a slightly older PHP, is there some way to see mail-related log entries? Might they go into the main error log?

        sneakyimp wrote:

        Might they go into the main error log?

        Any general SMTP errors that prevent the message from being accepted for delivery will generate PHP error messages (E_WARNING, E_ERROR, something along those lines - best to have error_reporting set to E_ALL at all times).

        However, note that if the problem occurs after the message is accepted for delivery by the MTA, then it should be obvious that there is no way that PHP can detect this let alone log anything about it.

          Write a Reply...