![]() |
SMTP library - _prep_q_encoding() function - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: SMTP library - _prep_q_encoding() function (/showthread.php?tid=59690) |
SMTP library - _prep_q_encoding() function - El Forum - 11-05-2013 [eluser]Unknown[/eluser] I am using Codeigniter SMTP email library to send emails, with following config values: Code: $config = array( Everything works fine, till I use an email subject which is more than 62 characters in length. The _prep_q_encoding() function performs "Q Encoding" on the subject. This function divides the subject into different lines ensuring that none of the lines exceed 76 characters including the 7 extra characters "=??Q??=" and the charset. At the end of each line, the crlf [which is "\r\n"] is appended and then each line is wrapped by the extra characters. Code: $str = trim(preg_replace('/^(.*)$/m', ' =?'.$this->charset.'?Q?$1?=', $str)); The above statement creates a problem as '?=' is added after '\r' [from crlf] of each line, resulting in transaction failed due to illegal header. Can someone please explain me, what exactly is happening and how can I solve the problem? Thanks, Anuj |