Email breaking lines with = sign |
|||
|---|---|---|---|
| Date: | 07/24/2007 | Severity: | Minor |
| Status: | Bogus | Reporter: | tilzinger |
| Version: | 1.5.4 | ||
| Keywords: | Libraries, Email Class | ||
Description
I noticed after upgrading to 1.5.4 my emails were not coming through properly to my Exchange server. The lines of text were being broken with = signs and my HTML is foobar. As soon as I switched back to 1.5.2, it worked just fine.
Code Sample
$config['mailtype'] = 'html';
$config['charset'] = 'UTF-8';
$this->email->initialize($config);
$to = ($this->uri->segment(5) == 'test') ? $this->config->item('admin_email') : $to;
$this->email->from($this->config->item('site_name'), $this->config->item('admin_name'));
$this->email->to($to);
$this->email->subject('Daily Reply Site Leads Overview Report');
$this->email->message($html);
// send it
$this->email->send();
// make sure settings are clear for next send in loop
$this->email->clear(TRUE);
Expected Result
Los Angeles 10
Kansas 1
National 1
Nebraska 1
Austin/Waco 3
Cincinnati 1
Albany 1
Actual Result
Los Angeles 10
Kansas 1=
National 1
Nebraska 1
Austin/Waco 3
Cincinnati
1<= /td>
Albany 1
=00
=00
Comment on Bug Report
| Posted by: Derek Jones on 24 July 2007 4:01pm | |
|
|
Try setting the $crlf class variable in Email.php to “\r\n”. What you are seeing are quoted-printable escape characters: an = at the end of a line is a soft-wrap, but should not be rendered by your email client. My guess is that the Exchange server needs the carriage return. Frankly, I’d love to use “\r\n” there by default, but there are a massive number of email servers that incorrectly convert \r to \n resulting in CRLFs of \n\n, which totally trashes the quoted-printable encoding. |
| Posted by: tilzinger on 24 July 2007 4:47pm | |
|
|
That still doesn’t fix it. I have better luck with 1.5.2, and I remembered I made this modification (http://codeigniter.com/forums/viewthread/47129/P0/) to 1.5.2 it awhile back… Email.php - ln. 936 //$hdr .= “Content-Transfer-Encoding: quoted/printable”; |
| Posted by: Derek Jones on 24 July 2007 5:01pm | |
|
|
CI uses the quoted-printable MIME type for HTML emails, and that fix may have undesirable results on most servers. The old email class had a bug in the naming of the MIME type (notice the / instead of -) which is what made a change necessary to begin with. I have confirmed with a few Exchange users that the current quoted-printable implementation works for them, so this may be a server configuration issue. To determine whether the problem is with the sending or receiving server, can you please send me an HTML email with the 1.5.4 Email class, using the email address we had previous contact with so I can examine the output? Use the Email class print debugger while sending this email and copy its output here to a codeblock, so we can compare what CI is handing off to the email server with what actually gets sent. |
| Posted by: Derek Jones on 30 January 2008 9:28am | |
|
|
Never heard back from you on this, tilzinger - can you provide an update and/or take the requested action above? |
| Posted by: tilzinger on 30 January 2008 11:04am | |
|
|
I stuck to 1.5.2, so I haven’t tested it any further. |
| Posted by: Derek Jones on 30 January 2008 11:21am | |
|
|
This bug report can be reopened if the requested information and reproducible code is provided using the latest SVN. |
