Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: RFC: Shortening line length in HTML Emails

by afoken (Chancellor)
on Oct 27, 2016 at 18:44 UTC ( [id://1174852]=note: print w/replies, xml ) Need Help??


in reply to RFC: Shortening line length in HTML Emails

Brute force attempt: Encode the HTML as-is in base64. Append that base64 blob to the mail. Indicate in a mail header that the message is base64-encoded. (Content-Transfer-Encoding: base64 should be sufficient.) Base64 has nice short lines. Any mail client that can handle HTML should be able to handle base64-encoded HTML. You are already sending bloat. So that 33% overhead of base64 won't make it much worse.

Other option: Encode as quoted-printable (Content-Transfer-Encoding: quoted-printable), break hard after N characters (typically N=75), and append a "=" at the break (soft break). See also Quoted-printable. I think there are modules at CPAN that en- and decode QP. QP usually does not add that much overhead as Base64, but it requires a little bit more "thinking" than stupidly shifting bits from and to base64.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Replies are listed 'Best First'.
Re^2: RFC: Shortening line length in HTML Emails
by LanX (Saint) on Oct 27, 2016 at 19:28 UTC
    > Encode the HTML as-is in base64. 

    Uh... That's actually a very good idea. Thanks.

    I'll stick for a while with my "solution" though because I'd like to have more control over the generated code.

    Many colleagues are non techies and think if cut and paste doesn't produce reliable results, it's the fault of the programmer.

    Telling them repeatedly that HTML emails are not meant to work like PDF doesn't help at all.

    so I have to train the software to annoy them... ;)

    Cheers Rolf
    (addicted to the Perl Programming Language and ☆☆☆☆ :)
    Je suis Charlie!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1174852]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (8)
As of 2024-04-18 09:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found