Page 1 of 1

Swift Mailer & Line Breaks

Posted: Wed Aug 23, 2006 7:29 pm
by akreider
d11wtq | This thread has been split from a deceased thread

I am having some trouble with line breaks. Swift Mailer (ver 1.21 for php 4) is adding line breaks.

**Original Text**
Felicia Perkins
Trinity, Alabama
http://www.campusactivism.org/displayperson-3990.htm


**SwiftMailer Output**
Felicia
Perkins
Trinity,
Alabama
http://www.campusactivism.org/displayperson-3990.htm

Not sure if this was fixed in a more recent version? I haven't upgraded, because of the frequency of new versions.

I tried using the regular php mail() function and that works fine.

For line breaks, I'm using \n.

Posted: Wed Aug 23, 2006 8:03 pm
by Chris Corbyn
If these are long(ish) lines it's not a bug, Swift had auto-compliance on by default in older versions (breaks long lines to be under the 76 char limit). It's no longer on by default.

You can turn it off with $swift->useAutoLineResizing(false). If that doesn't work you may want to post the code.

BTW: \n gets converted to \r\n internally with Swift in any case

Also note that version 2 has been available for over a month... ;)

EDIT | RE frequency of new versions. I'm currently having a version freeze for a month or so at least unless something critical crops up. I would advise upagrading. You have an awfully young version of the code.

Posted: Wed Aug 23, 2006 11:33 pm
by akreider
Umm, they aren't long lines. "Felicia Parkins" is less than 20 characters and got split up.

I'll try the new version and let you know.

Aaron

Posted: Thu Aug 24, 2006 3:26 pm
by akreider
I fixed the problem in the old version by replacing all my /n with /r/n - apparently Swift wasn't doing a good job of replacing them on its own (at least in 1.2).

Posted: Thu Aug 24, 2006 3:32 pm
by Chris Corbyn
akreider wrote:I fixed the problem in the old version by replacing all my /n with /r/n - apparently Swift wasn't doing a good job of replacing them on its own (at least in 1.2).
To be honest (I haven't dug that old version up to check) I'm not even sure early revisions of 1.2 implemented the LF --> CRLF compatabililty. That would make sense for the issue to. Some SMTP servers attrempt to do the replacement but they often end up making a mess of it :) :twisted: