]> git.mxchange.org Git - friendica.git/blobdiff - src/Util/Emailer.php
Add bower/base64 to Composer
[friendica.git] / src / Util / Emailer.php
index a2be983d6c03cb7ca78645831b5b836639161700..ba65296f507a2f3faaacf00ee6484cc94233c458 100644 (file)
@@ -5,11 +5,10 @@
 namespace Friendica\Util;
 
 use Friendica\Core\PConfig;
-
-require_once 'include/email.php';
+use Friendica\Protocol\Email;
 
 /**
- * @breif class to handle emailing
+ * @brief class to handle emailing
  */
 class Emailer
 {
@@ -38,8 +37,8 @@ class Emailer
                        $email_textonly = PConfig::get($params['uid'], "system", "email_textonly");
                }
 
-               $fromName = email_header_encode(html_entity_decode($params['fromName'], ENT_QUOTES, 'UTF-8'), 'UTF-8');
-               $messageSubject = email_header_encode(html_entity_decode($params['messageSubject'], ENT_QUOTES, 'UTF-8'), 'UTF-8');
+               $fromName = Email::encodeHeader(html_entity_decode($params['fromName'], ENT_QUOTES, 'UTF-8'), 'UTF-8');
+               $messageSubject = Email::encodeHeader(html_entity_decode($params['messageSubject'], ENT_QUOTES, 'UTF-8'), 'UTF-8');
 
                // generate a mime boundary
                $mimeBoundary   =rand(0, 9)."-"
@@ -73,12 +72,12 @@ class Emailer
                        "--" . $mimeBoundary . "--\n";                                  // message ending
 
                // send the message
-               $hookdata = array(
+               $hookdata = [
                        'to' => $params['toEmail'],
                        'subject' => $messageSubject,
                        'body' => $multipartMessageBody,
                        'headers' => $messageHeader
-               );
+               ];
                //echo "<pre>"; var_dump($hookdata); killme();
                call_hooks("emailer_send", $hookdata);
                $res = mail(