@@ 47-52 (lines=6) @@ | ||
44 | $mailResult = $mailer->send( $dest, $headers, $body ); |
|
45 | ||
46 | // Based on the result return an error string, |
|
47 | if ( PEAR::isError( $mailResult ) ) { |
|
48 | wfDebug( "PEAR::Mail failed: " . $mailResult->getMessage() . "\n" ); |
|
49 | return Status::newFatal( 'pear-mail-error', $mailResult->getMessage() ); |
|
50 | } else { |
|
51 | return Status::newGood(); |
|
52 | } |
|
53 | } |
|
54 | ||
55 | /** |
|
@@ 360-364 (lines=5) @@ | ||
357 | ||
358 | // Create the mail object using the Mail::factory method |
|
359 | $mail_object =& Mail::factory( 'smtp', $wgSMTP ); |
|
360 | if ( PEAR::isError( $mail_object ) ) { |
|
361 | wfDebug( "PEAR::Mail factory failed: " . $mail_object->getMessage() . "\n" ); |
|
362 | MediaWiki\restoreWarnings(); |
|
363 | return Status::newFatal( 'pear-mail-error', $mail_object->getMessage() ); |
|
364 | } |
|
365 | ||
366 | wfDebug( "Sending mail via PEAR::Mail\n" ); |
|
367 |