From 8e30d79b755a211011776b7b08e0e150d8d4f315 Mon Sep 17 00:00:00 2001 From: Milan Date: Thu, 15 Feb 2024 20:16:55 +0100 Subject: [PATCH] mail.pm: encode body by quoted printable * fix setting content-type in header * encode body using quoted printable Co-authored-by: Raphael Steppert --- lib/calcms/mail.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/calcms/mail.pm b/lib/calcms/mail.pm index 4b4dc08..0ae856d 100644 --- a/lib/calcms/mail.pm +++ b/lib/calcms/mail.pm @@ -3,26 +3,26 @@ package mail; use strict; use warnings; no warnings 'redefine'; -use utf8; use Email::Sender::Simple(); use Email::Simple(); use MIME::Words qw(encode_mimeword); -use Encode; +use MIME::QuotedPrint qw(encode_qp); sub send($) { my ($mail) = @_; my $email = Email::Simple->create( - 'Content-Type' => 'text/plain; charset=utf-8', header => [ + 'Content-Type' => 'text/plain;', + 'Content-Transfer-Encoding' => 'quoted-printable', 'From' => $mail->{'From'}, 'To' => $mail->{'To'}, 'Cc' => $mail->{'Cc'}, 'Reply-To' => $mail->{'Reply-To'}, 'Subject' => encode_mimeword($mail->{'Subject'}, 'b', 'UTF-8') ], - body => Encode::encode( utf8 => $mail->{'Data'} ), + body => encode_qp($mail->{'Data'}), ); Email::Sender::Simple->send($email); }