Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: User Registration


Sam Bauers
Participant

@sambauers

Looks like it may be rejecting the mail due to the “From” email address being invalid. Try this code in a plugin and make sure your admin_email option is a valid email address:

<?php
if ( !function_exists( 'bb_mail' ) ) :
function bb_mail( $to, $subject, $message, $headers = '' ) {
if (!is_array($headers)) {
$headers = trim($headers);
$headers = preg_split('@r(?:n{0,1})|n@', $headers);
}

if (!count($headers) || !count(preg_grep('/^from:s/im', $headers))) {
if (!$from = bb_get_option('admin_email'))
if ($uri_parsed = parse_url(bb_get_option('uri')))
if ($uri_parsed['host'])
$from = 'bbpress@' . trim(preg_replace('/^www./i', '', $uri_parsed['host']));

if ($from)
$headers[] = 'From: "' . bb_get_option('name') . '" <' . $from . '>';
}
$headers = trim(join("rn", $headers));

return @mail($to, $subject, $message, $headers);
}
endif;
?>

Skip to toolbar