[SOLVED] html email and format=flowed

Swift Mailer is a fantastic library for sending email with php. Discuss this library or ask any questions about it here.

Moderators: Chris Corbyn, General Moderators

Post Reply
ollip1
Forum Newbie
Posts: 6
Joined: Sun Oct 08, 2006 3:11 am

[SOLVED] html email and format=flowed

Post by ollip1 »

I changed to the newest (a very good) version of Swift. I found that the basic setting of sending multipart email changed NOT containing format=flowed

Previous version:

Code: Select all

Content-Type: text/html; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: quoted-printable
Without format=flowed my extensive css settings are not shown. I added following code

Code: Select all

$message->attach(new Swift_Message_Part($html, "text/html", "format=flowed"));
Actually I don't know if that's really right but I got following code to email before html part:

Code: Select all

Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: format=flowed
And it shows html right in the email reader.
Is there poossibly some problems if some email readers or servers cut line lengths to 80 chars? Or is there some better solutions to this? Thanks.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Code: Select all

$message->attach(new Swift_Message_Part($html, "text/html", "format=flowed"));
It's actually:

Code: Select all

$part = new Swift_Message_Part($html, "text/html");
$part->setFlowed(true);
$message->attach($part);
:)

There are no real issues. In the last version it was always flowed, but this actually presents a few minor limitations such as not being able to put > at the start of a line without it having special meaning. You just need to turn it on now that all :)

The 80 char limit can pretty much be lifted to 1000 safely these days. I only have it set low because I use pine (as do a lot of people who like command line tools) and 1000 chars is a very long line in pine.

Code: Select all

$part->setLineWrap(1000);
ollip1
Forum Newbie
Posts: 6
Joined: Sun Oct 08, 2006 3:11 am

continuing ok

Post by ollip1 »

Thanks!
There was left some issues maybe to deal with them later but I can ciontinue now.

Donation for lotion is on the way.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: continuing ok

Post by Chris Corbyn »

ollip1 wrote:Thanks!
There was left some issues maybe to deal with them later but I can ciontinue now.

Donation for lotion is on the way.
Ah were you the anonymous donor who sent something with the message 'Thanks!'?

Thank you indeed :)
Post Reply