* (bug 3211) Include Date, To mail headers when using PEAR::Mail
authorBrion Vibber <brion@users.mediawiki.org>
Mon, 12 Dec 2005 04:51:53 +0000 (04:51 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Mon, 12 Dec 2005 04:51:53 +0000 (04:51 +0000)
RELEASE-NOTES
includes/UserMailer.php

index 539513f..9b6e16a 100644 (file)
@@ -313,6 +313,7 @@ fully support the editing toolbar, but was found to be too confusing.
 * (bug 4001) Use local variables properly in wikibits.js akeytt()
 * Fix regression: old version missing from edit links on CSS/JS pages
 * (bug 3073) Keep search parameter on paging in Special:Newimages
+* (bug 3211) Include Date, To mail headers when using PEAR::Mail
 
 
 === Caveats ===
index 91899cd..67c7176 100644 (file)
@@ -56,10 +56,12 @@ function userMailer( $to, $from, $subject, $body, $replyto=false ) {
                $timestamp = time();
 
                $headers['From'] = $from;
+               $headers['To'] = $to;
                if ( $replyto ) {
                        $headers['Reply-To'] = $replyto;
                }
                $headers['Subject'] = $subject;
+               $headers['Date'] = date( 'r' );
                $headers['MIME-Version'] = '1.0';
                $headers['Content-type'] = 'text/plain; charset='.$wgOutputEncoding;
                $headers['Content-transfer-encoding'] = '8bit';
@@ -75,8 +77,10 @@ function userMailer( $to, $from, $subject, $body, $replyto=false ) {
                if ($mailResult === true) {
                        return '';
                } elseif (is_object($mailResult)) {
+                       wfDebug( "PEAR::Mail failed: " . $mailResult->getMessage() . "\n" );
                        return $mailResult->getMessage();
                } else {
+                       wfDebug( "PEAR::Mail failed, unknown error result\n" );
                        return 'Mail object return unknown error.';
                }
        } else  {