summaryrefslogtreecommitdiff
path: root/lib/Travelynx/Helper/Sendmail.pm
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2020-03-14 14:56:02 +0100
committerDaniel Friesel <derf@finalrewind.org>2020-03-14 14:56:02 +0100
commite7a6cfa9311f463d9e3e96b6b56c998246b0652f (patch)
tree9ffeebd35913a10cddc1cef66e19d88286237711 /lib/Travelynx/Helper/Sendmail.pm
parent871a44f15e7b59120fe04c033c2158785f5af216 (diff)
Correctly encode non-ASCII e-mail content. Fixes spamfilter issues.1.15.8
New dependency: MIME::Entity
Diffstat (limited to 'lib/Travelynx/Helper/Sendmail.pm')
-rw-r--r--lib/Travelynx/Helper/Sendmail.pm18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/Travelynx/Helper/Sendmail.pm b/lib/Travelynx/Helper/Sendmail.pm
index 73b08cd..d7c66b6 100644
--- a/lib/Travelynx/Helper/Sendmail.pm
+++ b/lib/Travelynx/Helper/Sendmail.pm
@@ -7,7 +7,7 @@ use 5.020;
use Encode qw(encode);
use Email::Sender::Simple qw(try_to_sendmail);
-use Email::Simple;
+use MIME::Entity;
sub new {
my ( $class, %opt ) = @_;
@@ -18,14 +18,14 @@ sub new {
sub custom {
my ( $self, $to, $subject, $body ) = @_;
- my $reg_mail = Email::Simple->create(
- header => [
- To => $to,
- From => $self->{config}{from},
- Subject => $subject,
- 'Content-Type' => 'text/plain; charset=UTF-8',
- ],
- body => encode( 'utf-8', $body ),
+ my $reg_mail = MIME::Entity->build(
+ To => $to,
+ From => $from,
+ Subject => encode( 'MIME-Header', $subject ),
+ Type => 'text/plain',
+ Charset => 'UTF-8',
+ Encoding => 'quoted-printable',
+ Data => encode( 'utf-8', $body ),
);
if ( $self->{config}->{disabled} ) {