gleez/cms — pull request #567 by sergeyklay (2013-11-07 01:02:14+00:00)
Title: Email

+ Removed `gleez` namespace for `Email` class (`Gleez_Email` => `Email`)
+ Translated some message to Russian language
+ Fixed PHPDoc
+ Modified some message (for example `Rejoice` => `Congratulations`)
+ Updated PHPMailer from official repo to `5.2.7`
+ Added i18n support to PHPMailer (see language subdir)
+ Fixed charset in Gleez `Email` class
+ Added log destination instead 'echo' in Gleez `Email` class
+ Fixed method calls in accordance with the new PHPMailer API

**Attention!**

+ Fixed bug associated with incorrect coding header. And therefore, if the title is uses not only Latin characters - it will be unreadable

___It seem to me___ this is PHPMailer bug. I spent the whole evening and half the night to find a solution to this problem. But it seemed to me, the solution is to change the 'class.phpmailer.php' class. Please see screenshot:
![mail_title_encoding](https://f.cloud.github.com/assets/1256298/1488257/4286a1ce-4745-11e3-965c-3150fe386bb3.png)

^ Mail header
~~~
Return-Path:
Received: from cerber.homedomain ([213.87.143.240])
by mx.google.com with ESMTPSA id ac2sm829046lbc.10.2013.11.06.15.52.11
for
(version=TLSv1.2 cipher=RC4-SHA bits=128/128);
Wed, 06 Nov 2013 15:52:12 -0800 (PST)
Received: from www-data by cerber.homedomain with local (Exim 4.80)
(envelope-from )
id 1VeCtq-0001ha-2l
for sadhooklay@gmail.com; Thu, 07 Nov 2013 03:52:38 +0400
To: Sergey
Subject: =?UTF-8?B?PT91dGYtOD9CP1IyeGxaWG9nUTAxVElDMGcw?=
=?UTF-8?B?Si9SZ05DKzBMTFF0ZEdBMExyUXNDRFJnTkMxMExQUXVOR0IwWUxSZ05Ddz89?=
=?UTF-8?B?CiA9P3V0Zi04P0I/MFliUXVOQyswTDNRdmRHTDBZVWcwTFRRc05DOTBMM1Jp?=
=?UTF-8?B?OUdGSU5DMDBMdlJqeUJUWlhKblpYaz0/PQ==?=
X-PHP-Originating-Script: 1000:class.phpmailer.php
Date: Wed, 6 Nov 2013 23:52:37 +0000
From: Gleez CMS
Message-ID:
X-Priority: 3
X-Mailer: Gleez CMS 0.10.5
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
~~~

A similar problem observed everyone who sends headers (subject) with non-Latin character. The problem associated with the UTF-8 string which is divided into blocks of 78 bytes. Probably with short strings is no problem. I really have tried different methods of decoding the line and have not found solutions. Any ideas?

I made the decision use in this particular case - the short header, which contains the name of the site (usually English), and the user login (in English). In some of those cases where the name of the site contains non-Latin characters, the length of the line can be enough. Or maybe lacked - it means you're unlucky and your users will see in their inbox hieroglyphs in the title :)

**Note!**
This issue don't relates to mail body, only to title (subject).

@sandeepone Maybe we should consider an alternative - Sviftmailer.