Skip to content

Commit

Permalink
Encode text/* mime parts with quoted-printable
Browse files Browse the repository at this point in the history
  • Loading branch information
mludvig committed Oct 19, 2011
1 parent 47734e5 commit a682e2c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions smtp-cli
Expand Up @@ -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;
Expand Down

0 comments on commit a682e2c

Please sign in to comment.