} else {
return $this->address;
}
+ } else {
+ return "";
}
}
} else if( $to->address ) {
$dest[] = $to->address;
}
+ if ( count( $dest ) == 0 ) {
+ return Status::newFatal( 'user-mail-no-addy' );
+ }
if ( $wgEnotifImpersonal ) {
$headers['To'] = 'undisclosed-recipients:;';
ini_set( 'html_errors', '0' );
set_error_handler( 'UserMailer::errorHandler' );
- if ( !is_array( $to ) ) {
- $to = array( $to );
- }
- foreach ( $to as $recip ) {
- $sent = mail( $recip->toString(), self::quotedPrintable( $subject ), $body, $headers, $wgAdditionalMailParams );
+ foreach ( $dest as $recip ) {
+ $sent = mail( $recip, self::quotedPrintable( $subject ), $body, $headers, $wgAdditionalMailParams );
}
restore_error_handler();
'pear-mail-error' => '$1', # do not translate or duplicate this message to other languages
'php-mail-error' => '$1', # do not translate or duplicate this message to other languages
'php-mail-error-unknown' => "Unknown error in PHP's mail() function",
+'user-mail-no-addy' => "Tried to send email without an email address",
# Change password dialog
'resetpass' => 'Change password',