I know that this is an old thread, but I just came upon it...
> In miniBB, you can add/edit all email headers in function sendMail which is stored in bb_functions.php
Yes, this is where the solution lies. I resolved a similar mail() problem (not with miniBB) by adding additional headers that some spam filters are apparently looking for. In bb_functions.php
search for the line that begins:
Immediately after the ending semi-colon(;), add the following, each on a new line:
$from_email .= "MIME-Version: 1.0\n";
$from_email .= "Content-Type: text/plain;\n\tcharset=\"iso-8859-1\"\n";
My forums are on a linux server, and mail would not work with the \r\n line endings, thus the reason I show only the \n (newline) character. Since you said yours works "sometimes," you may need to substitute \r\n every place I show \n (above).
The above code concatenates the MIME-Version and Content-Type headers to what miniBB was already sending. If you are using a different character set (codepage), substitute it for iso-8859-1 (which should be okay for English and most western EU languages). Note that RFC 2045 requires
"MIME-Version" header, and states that the absence of "charset" causes it to default to US-ASCII. The following links may be useful to your understanding:
RFC 2045 - MIME Format
RFC 2046 - MIME Media Types
ISO 8859-x Character Sets