Fixed libraries/Email.php: UTF8 subject line encoding for Apple Mail (and iOS Mail) / WordWrap for plaintext email #1281

Closed
wants to merge 5 commits into
from
View
8 system/libraries/Email.php
@@ -368,11 +368,12 @@ public function bcc($bcc, $limit = '')
*/
public function subject($subject)
{
- $subject = $this->_prep_q_encoding($subject);
+ $subject = '=?UTF-8?B?'.base64_encode($subject).'?=';
$this->_set_header('Subject', $subject);
return $this;
}
+
// --------------------------------------------------------------------
/**
@@ -760,7 +761,7 @@ protected function _get_alt_message()
{
if ($this->alt_message != '')
{
- return $this->word_wrap($this->alt_message, '76');
+ return ($this->wordwrap) ? $this->word_wrap($this->alt_message) : $this->alt_message;
}
$body = (preg_match('/\<body.*?\>(.*)\<\/body\>/si', $this->_body, $match)) ? $match[1] : $this->_body;
@@ -771,9 +772,10 @@ protected function _get_alt_message()
$body = str_replace(str_repeat("\n", $i), "\n\n", $body);
}
- return $this->word_wrap($body, 76);
+ return ($this->wordwrap) ? $this->word_wrap($body) : $body;
}
+
// --------------------------------------------------------------------
/**