From aae52f6b70dc658c26f46494c6289017e757d160 Mon Sep 17 00:00:00 2001 From: Joshua Ferraro Date: Sun, 10 Aug 2008 14:42:47 -0500 Subject: [PATCH] Fix for 2492: Mail::Sendmail chokes on utf-8 [ process_message_queue.pl ] --- C4/Letters.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/C4/Letters.pm b/C4/Letters.pm index 73608b0afe..35dc5647a3 100644 --- a/C4/Letters.pm +++ b/C4/Letters.pm @@ -23,6 +23,7 @@ use Mail::Sendmail; use C4::Members; use C4::Log; use C4::SMS; +use Encode; use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); @@ -748,12 +749,13 @@ sub _send_message_by_email { my $message = shift; my $member = C4::Members::GetMember( $message->{'borrowernumber'} ); - + my $content = encode('utf8', $message->{'content'}); my %sendmail_params = ( To => $message->{'to_address'} || $member->{'email'}, From => $message->{'from_address'} || C4::Context->preference('KohaAdminEmailAddress'), Subject => $message->{'subject'}, - Message => $message->{'content'}, + charset => 'utf8', + Message => $content, ); if ($message->{'content_type'}) { $sendmail_params{'content-type'} = $message->{'content_type'}; -- 2.39.5