Skip to content
Snippets Groups Projects
Commit 9fcff693 authored by Peter Rotich's avatar Peter Rotich
Browse files

Remove forced utf8 encoding and let the PEAR/Mail/smtp handle it

parent 5aaf6b5b
No related branches found
No related tags found
No related merge requests found
......@@ -66,7 +66,7 @@ class Mailer {
function getFromAddress() {
if(!$this->ht['from'] && ($email=$this->getEmail()))
$this->ht['from'] =sprintf('"%s" <%s>', $this->str_utf8($email->getName()?$email->getName():$email->getEmail()), $email->getEmail());
$this->ht['from'] =sprintf('"%s" <%s>', ($email->getName()?$email->getName():$email->getEmail()), $email->getEmail());
return $this->ht['from'];
}
......@@ -84,12 +84,6 @@ class Mailer {
$this->attachments = array_merge($this->attachments, $attachments);
}
/* utils */
function str_utf8($text) {
return "=?utf-8?b?".base64_encode($text)."?=";
}
function send($to, $subject, $message, $options=null) {
global $ost;
......@@ -109,7 +103,7 @@ class Mailer {
$headers = array (
'From' => $this->getFromAddress(),
'To' => $to,
'Subject' => $this->str_utf8($subject),
'Subject' => $subject,
'Date'=> date('D, d M Y H:i:s O'),
'Message-ID' => $messageId,
'X-Mailer' =>'osTicket Mailer',
......@@ -140,7 +134,7 @@ class Mailer {
//encode the body
$body = $mime->get($encodings);
//encode the headers.
$headers = $mime->headers($headers);
$headers = $mime->headers($headers, true);
if(($smtp=$this->getSMTPInfo())) { //Send via SMTP
$mail = mail::factory('smtp',
array ('host' => $smtp['host'],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment