Many bbpress user complaining that registration mails (passwords) never reach the mailbox from a new member. I know from a few members that this happens with this forum too.
Some complains should be related to DNS settings like missing SPF records or non configured reverse DNS.
After checking the mail function within bbpress I have noticed that the mail function doesn't send a full set of (required) mail headers. Inside the the file "pluggable.php" there is a check if the function exists:
if ( !function_exists( 'bb_mail' ) ) :
function bb_mail( $to, $subject, $message, $headers = '' ) {
$headers = trim($headers);
if ( !preg_match( '/^from:\s/im', $headers ) ) {
$from = parse_url( bb_get_option( 'domain' ) );
if ( !$from || !$from['host'] ) {
$from = '';
} else {
$from_host = $from['host'];
if ( substr( $from_host, 0, 4 ) == 'www.' )
$from_host = substr( $from_host, 4 );
$from = 'From: "' . bb_get_option( 'name' ) . '" <bbpress@' . $from_host . '>';
}
$headers .= "\n$from";
$headers = trim($headers);
}
return @mail( $to, $subject, $message, $headers );
}
endif;
With check it's easy in the current version to add a new function to some plugin file. I decided to use phpmailer to send all the mails. I created a function inside my personal plugin file:
function bb_mail($to, $subject, $message, $headers = '') {
$mail = new PHPMailer();
$mail->IsSendmail();
$mail->From = 'postings@domain.com';
$mail->FromName = 'domain.com';
$mail->AddAddress($to);
$mail->Subject = $subject;
$mail->Body = $message;
if($mail->Send()) {
return true;
} else {
return false;
}
}
This way the function provided by bbpress is not used and the mail messages are send via phpmailer (don't forget to include the class file).
I didn't test this solution together with wordpress.