phpBB problem with any call to PHP’s mail function

After fighting for a while to figure out why a phpBB installation (migrated to my new server) wouldn’t send out email notifications, and digging through non-existent logs, I have figured out the problem. When a new registration would come through, or when a user would get a new private message, no email notification would be sent out. In the phpBB error log (in ACP), the only error listed was:

E-mail error
» EMAIL/PHP/mail()

In order to troubleshoot whether it was a phpBB problem or PHP mail() problem, I used this little mailer script:

$to = “”;
$subject = “Test”;
$message = “Test of PHP mail function.”;
$from = “”;
$headers = “From: $from”;
echo “Mail Sent.”;

Low and behold, that email failed. What was the problem in my case? Well, in my php.ini (for Apache, not CLI), the following was listed for sendmail:


and that is the correct path for my Gentoo server. However, I needed to add the -t option to it:

/usr/sbin/sendmail -t

The -t option “Read[s] message for recipients. To:, Cc:, and Bcc: lines will be scanned for recipient addresses. The Bcc: line will be deleted before transmission.”

After that option was added, I restarted Apache and everything worked nicely.

Hope that helps anyone in the same situation.



    • Jokey on Saturday, 4 December 2010 at 22:59
    • Reply

    Unless I’m mistaken that used to be default setting anyway…

    Curious if that changed meanwhile

    • Toralf Förster on Saturday, 4 December 2010 at 17:45
    • Reply


    I’ve this in my php.ini :

    ; For Unix only. You may supply arguments as well (default: “sendmail -t -i”).

    Shouldn’t this be enough ?

Leave a Reply

Your email address will not be published.