mail.pm: encode UTF-8 header

This commit is contained in:
Milan
2023-05-20 07:58:07 +02:00
parent 3effdd6ef0
commit 611fad43d4

View File

@@ -3,9 +3,11 @@ package mail;
use strict; use strict;
use warnings; use warnings;
no warnings 'redefine'; no warnings 'redefine';
use utf8;
use Email::Sender::Simple(); use Email::Sender::Simple();
use Email::Simple(); use Email::Simple();
use MIME::Words qw(encode_mimeword);
sub send($) { sub send($) {
my ($mail) = @_; my ($mail) = @_;
@@ -17,7 +19,7 @@ sub send($) {
'To' => $mail->{'To'}, 'To' => $mail->{'To'},
'Cc' => $mail->{'Cc'}, 'Cc' => $mail->{'Cc'},
'Reply-To' => $mail->{'Reply-To'}, 'Reply-To' => $mail->{'Reply-To'},
'Subject' => $mail->{'Subject'} 'Subject' => encode_mimeword($mail->{'Subject'}, 'b', 'UTF-8')
], ],
body => $mail->{'Data'}, body => $mail->{'Data'},
); );