From a682e2c025f2d308e8e4162385f3c42018f96df9 Mon Sep 17 00:00:00 2001 From: Michal Ludvig Date: Wed, 19 Oct 2011 16:49:08 +1300 Subject: [PATCH] Encode text/* mime parts with quoted-printable --- smtp-cli | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/smtp-cli b/smtp-cli index 2bb5ab8..ad69a29 100755 --- a/smtp-cli +++ b/smtp-cli @@ -743,10 +743,12 @@ sub safe_attach($$) sub mime_message($$) { my ($type, $data) = @_; - ## MIME::Lite doesn't allow setting Type and Data once the - ## object is created. Well, maybe it does but I don't know how. + + ## Set QP encoding for text/* types, let MIME::Lite decide for all other types. + my $encoding = $type =~ /^text\// ? "quoted-printable" : undef; my $message = MIME::Lite->new( Type => $type, + Encoding=> $encoding, Data => $data); $message->attr('content-type.charset' => $charset) if (($type =~ /^text\//i) and defined($charset)); return $message;