diff options
-rw-r--r-- | engine/lib/notification.php | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/engine/lib/notification.php b/engine/lib/notification.php index c483f1ed8..bdfbf65c3 100644 --- a/engine/lib/notification.php +++ b/engine/lib/notification.php @@ -237,15 +237,23 @@ } else*/ $from = 'noreply@' . get_site_domain($CONFIG->site_guid); // Handle a fallback - - mb_internal_encoding('UTF-8'); - $site = get_entity($CONFIG->site_guid); - $sitename = mb_encode_mimeheader($site->name,"UTF-8", "B"); +
+ if (is_callable('mb_internal_encoding')) { + mb_internal_encoding('UTF-8');
+ } + $site = get_entity($CONFIG->site_guid);
+ $sitename = $site->name;
+ if (is_callable('mb_encode_mimeheader')) { + $sitename = mb_encode_mimeheader($site->name,"UTF-8", "B");
+ } $headers = "From: $sitename <$from>\r\n" . "Content-Type: text/plain; charset=UTF-8; format=flowed\r\n" . "MIME-Version: 1.0\r\n" - . "Content-Transfer-Encoding: 8bit\r\n"; - $subject = mb_encode_mimeheader($subject,"UTF-8", "B"); + . "Content-Transfer-Encoding: 8bit\r\n";
+
+ if (is_callable('mb_encode_mimeheader')) { + $subject = mb_encode_mimeheader($subject,"UTF-8", "B");
+ } return mail($to, $subject, wordwrap($message), $headers); } |