*/
namespace Friendica\Protocol;
-require_once 'include/html2plain.php';
+use Friendica\Content\Text\HTML;
+use Friendica\Core\Protocol;
/**
* @brief Email class
$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;
}
if (trim($ret['body']) == '') {
$ret['body'] = self::messageGetPart($mbox, $uid, $struc, 0, 'plain');
} else {
- $ret['body'] = html2bbcode($ret['body']);
+ $ret['body'] = HTML::toBBCode($ret['body']);
}
} else {
$text = '';
}
}
if (trim($html) != '') {
- $ret['body'] = html2bbcode($html);
+ $ret['body'] = HTML::toBBCode($html);
} else {
$ret['body'] = $text;
}
}
/**
- * 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
$body .= "Content-Transfer-Encoding: 8bit\n";
$body .= "Content-Type: text/plain; charset=utf-8; format=flowed\n\n";
- $body .= html2plain($html)."\n";
+ $body .= HTML::toPlaintext($html)."\n";
$body .= "--=_".$part."\n";
$body .= "Content-Transfer-Encoding: 8bit\n";