]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/Email.php
Added to-do
[friendica.git] / src / Protocol / Email.php
index 671e6a3edddee861d1b28621aea01f04b3960a6c..00122e2eaeb3781b6463aaafb3c9b61815a3962f 100644 (file)
@@ -5,8 +5,7 @@
 namespace Friendica\Protocol;
 
 use Friendica\Content\Text\HTML;
-
-require_once 'include/html2plain.php';
+use Friendica\Core\Protocol;
 
 /**
  * @brief Email class
@@ -27,6 +26,16 @@ class Email
 
                $mbox = @imap_open($mailbox, $username, $password);
 
+               $errors = imap_errors();
+               if (!empty($errors)) {
+                       logger('IMAP Errors occured: ' . json_encode($errors));
+               }
+
+               $alerts = imap_alerts();
+               if (!empty($alerts)) {
+                       logger('IMAP Alerts occured: ' . json_encode($alerts));
+               }
+
                return $mbox;
        }
 
@@ -300,7 +309,7 @@ class Email
        }
 
        /**
-        * Function send is used by NETWORK_EMAIL and NETWORK_EMAIL2 code
+        * Function send is used by Protocol::EMAIL and Protocol::EMAIL2 code
         * (not to notify the user, but to send items to email contacts)
         *
         * @param string $addr    address
@@ -330,7 +339,7 @@ class Email
                $body .= "Content-Transfer-Encoding: 8bit\n";
                $body .= "Content-Type: text/plain; charset=utf-8; format=flowed\n\n";
 
-               $body .= Friendica\Content\Text\HTML::toPlaintext($html)."\n";
+               $body .= HTML::toPlaintext($html)."\n";
 
                $body .= "--=_".$part."\n";
                $body .= "Content-Transfer-Encoding: 8bit\n";