[Haskell-cafe] Question: mime-mail and base64 encoding

Nathan Howell nathan.d.howell at gmail.com
Tue Dec 7 07:21:35 CET 2010

On Mon, Dec 6, 2010 at 8:42 PM, Michael Snoyman <michael at snoyman.com> wrote:
> The request is to make both the HTML and plain text parts use base64
> encoding by default. This *seems* to me to make a lot of sense, since
> it will ensure that your message arrives exactly as you intended it,
> and will ensure that any non-ASCII code points don't get killed
> somewhere along the way. On the other hand, I'm not sure what client
> support is like for base-64 encoding. Don't we need to leave *some*
> form of non-encoded data for less sophisticated email clients?

The way I've seen it done before was to:
- calculate the size of the body in quoted-printable and base64 encoding
- select the smaller encoded form of the two

quoted-printable is fairly human readable. This strategy also works
for encoding headers, particularly Subject: lines (substituting
q-encoding for qp).


More information about the Haskell-Cafe mailing list