Forcing quoted-printable on text/plain-part

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
User avatar
joho
Forum Newbie
Posts: 16
Joined: Tue Oct 17, 2006 4:34 am
Location: Stockholm, Sweden

Forcing quoted-printable on text/plain-part

Post by joho »

How do I force the text/plain-part to be encoded using quoted-printable instead of 8bit encoding?

I've tried passing 'text/plain' and 'quoted-printable' as the second and third parameters to the addpart()-method, but as soon as the text contains 8bit characters (åäö), Swift insists on 8bit encoding, which I don't want.
User avatar
joho
Forum Newbie
Posts: 16
Joined: Tue Oct 17, 2006 4:34 am
Location: Stockholm, Sweden

Post by joho »

OK; I found out that if I set the last parameter to the send()-method to 'quoted-printable', I almost get what I want. The stuff is encoded as qp, with the exception of the subject, which still seems to be base64-(en)coded.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

joho wrote:OK; I found out that if I set the last parameter to the send()-method to 'quoted-printable', I almost get what I want. The stuff is encoded as qp, with the exception of the subject, which still seems to be base64-(en)coded.
Don't pass a body to send() if you're using addPart() or the parts you add will be ignored in favour of the body passed to send().

Headers are done with base64 currently. That can't be adjusted externally although I don't see a big harm in changing things to allow it to be specified. Many SMTP servers still can't handle true 8-bit submissions so they require a 7-bit transfer encoding to be used.
User avatar
joho
Forum Newbie
Posts: 16
Joined: Tue Oct 17, 2006 4:34 am
Location: Stockholm, Sweden

Post by joho »

I'm passing FALSE to send in my latest trial (where I want to set the encoding).

The problem is that we've run into some oddball implementations that cannot handle base64-encoded subjects and what not, thus the need (want) to use qp.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

joho wrote:I'm passing FALSE to send in my latest trial (where I want to set the encoding).

The problem is that we've run into some oddball implementations that cannot handle base64-encoded subjects and what not, thus the need (want) to use qp.
I see... I haven't ever seen this. Adding the option is trivial anyway -- another change to put on my list for tonight.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Try downloading 2.1.17 which I've just put up and then call:

Code: Select all

$swift->setHeaderEncoding('QP');
:)
User avatar
joho
Forum Newbie
Posts: 16
Joined: Tue Oct 17, 2006 4:34 am
Location: Stockholm, Sweden

Post by joho »

Nice one; tested and confirmed. Thanks.
Post Reply