From 3c672b0d4ebf912eb67887291a282b25d1aae0ca Mon Sep 17 00:00:00 2001 From: Markus Birth Date: Thu, 4 Aug 2016 18:13:39 +0200 Subject: [PATCH] Finishing touches on GmailTransport. --- lib/Frs/Output/Transport/GmailTransport.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/Frs/Output/Transport/GmailTransport.php b/lib/Frs/Output/Transport/GmailTransport.php index 8779def..f732dfb 100644 --- a/lib/Frs/Output/Transport/GmailTransport.php +++ b/lib/Frs/Output/Transport/GmailTransport.php @@ -10,9 +10,9 @@ class GmailTransport implements TransportInterface private $headers; private $content; - public function _construct(\Frs\SessionManager $sm) + public function __construct(\Frs\SessionManager $sm) { - $this->gms = new Google_Service_Gmail($sm->getGoogleClient()); + $this->gms = new \Google_Service_Gmail($sm->getGoogleClient()); } public function setContent($content) @@ -49,7 +49,9 @@ class GmailTransport implements TransportInterface public function transmit() { - $mime = new Mail_mime(); + $mime = new \Mail_mime(); + $mime->setParam('html_charset', 'utf-8'); + $mime->setParam('html_encoding', '8bit'); $mime->addTo($this->recipients); $mime->setHTMLBody($this->content); $mime->setSubject($this->subject); @@ -57,7 +59,7 @@ class GmailTransport implements TransportInterface $message_body = $mime->getMessage(null, null, $this->headers); $encoded_message = $this->b64url_encode($message_body); - $postBody = new Google_Service_Gmail_Message(); + $postBody = new \Google_Service_Gmail_Message(); $postBody->setRaw($encoded_message); $msg = $this->gms->users_messages->send('me', $postBody);