* @addtogroup SpecialPage
*/
-require_once('UserMailer.php');
-
/**
* @todo document
*/
// This is a bit ugly, but will serve to differentiate
// wiki-borne mails from direct mails and protects against
// SPF and bounce problems with some mailers (see below).
- global $wgEmergencyContact;
- $mailFrom = new MailAddress( $wgEmergencyContact );
+ global $wgPasswordSender;
+ $mailFrom = new MailAddress( $wgPasswordSender );
$replyTo = $from;
} else {
// Put the sending user's e-mail address in the From: header.
$mailResult = UserMailer::send( $to, $mailFrom, $subject, $this->text, $replyTo );
if( WikiError::isError( $mailResult ) ) {
- $wgOut->addHTML( wfMsg( "usermailererror" ) . $mailResult);
+ $wgOut->addHTML( wfMsg( "usermailererror" ) .
+ ' ' . htmlspecialchars( $mailResult->getMessage() ) );
} else {
// if the user requested a copy of this mail, do this now,
if ($this->cc_me && $to != $from) {
$cc_subject = wfMsg('emailccsubject', $this->target->getName(), $subject);
if( wfRunHooks( 'EmailUser', array( &$from, &$from, &$cc_subject, &$this->text ) ) ) {
- $ccResult = userMailer( $from, $from, $cc_subject, $this->text );
+ $ccResult = UserMailer::send( $from, $from, $cc_subject, $this->text );
if( WikiError::isError( $ccResult ) ) {
// At this stage, the user's CC mail has failed, but their
// original mail has succeeded. It's unlikely, but still, what to do?
// We can either show them an error, or we can say everything was fine,
// or we can say we sort of failed AND sort of succeeded. Of these options,
// simply saying there was an error is probably best.
- $wgOut->addHTML( wfMsg( "usermailererror" ) . $ccResult);
+ $wgOut->addHTML( wfMsg( "usermailererror" ) .
+ ' ' . htmlspecialchars( $ccResult->getMessage() ) );
return;
}
}