Fixed bug #5158: log failed mailings of t3lib_div::plainMailEncoded()
authorMartin Kutschker <martin.t.kutschker@blackbox.net>
Tue, 1 May 2007 18:40:12 +0000 (18:40 +0000)
committerMartin Kutschker <martin.t.kutschker@blackbox.net>
Tue, 1 May 2007 18:40:12 +0000 (18:40 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@2316 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_div.php

index 18560c8..00b6cc5 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
 2007-05-01  Martin Kutschker  <martin.t.kutschker@blackbox.net>
 
        * Fixed bug #2515: jsfunc.validateform.js does not verify password fields (thanks to Joerg Wagner)
+       * Fixed bug #5158: log failed mailings of t3lib_div::plainMailEncoded()
 
 2007-04-30  Michael Stucki  <michael@typo3.org>
 
index ca58165..4c96366 100755 (executable)
@@ -4152,7 +4152,7 @@ class t3lib_div {
         * @param       string          Encoding type: "base64", "quoted-printable", "8bit". Default value is "quoted-printable".
         * @param       string          Charset used in encoding-headers (only if $encoding is set to a valid value which produces such a header)
         * @param       boolean         If set, the header content will not be encoded.
-        * @return      void
+        * @return      boolean         True if mail was accepted for delivery, false otherwise
         */
        function plainMailEncoded($email,$subject,$message,$headers='',$encoding='quoted-printable',$charset='',$dontEncodeHeader=false)        {
                if (!$charset)  {
@@ -4211,7 +4211,11 @@ class t3lib_div {
 
                $headers=trim(implode($linebreak,t3lib_div::trimExplode(chr(10),$headers,1)));  // Make sure no empty lines are there.
 
-               mail($email,$subject,$message,$headers);
+               $ret = @mail($email,$subject,$message,$headers);
+               if (!$ret)      {
+                       t3lib_div::sysLog('Mail to "'.$email.'" could not be sent (Subject: "'.$subject.'").', 'Core', 3);
+               }
+               return $ret;
        }
 
        /**