@@ -, +, @@ and resultset with accented characters. For example: ./runreport.pl --subject="éèà" --to=me@home.org 1 ./runreport.pl --format=html --subject="éèà" --to=me@home.org 1 The first email contains badly encoded subject & message. The second email contains badly encoded subject, but correct message. --- misc/cronjobs/runreport.pl | 25 ++++++------------------- 1 files changed, 6 insertions(+), 19 deletions(-) --- a/misc/cronjobs/runreport.pl +++ a/misc/cronjobs/runreport.pl @@ -273,27 +273,14 @@ foreach my $report_id (@ARGV) { } } if ($email){ - my $email = Koha::Email->new(); - my %mail; + my $args = { to => $to, from => $from, subject => $subject }; if ($format eq 'html') { - $message = "$message"; - %mail = $email->create_message_headers({ - to => $to, - from => $from, - contenttype => 'text/html', - subject => encode('utf8', $subject ), - message => encode('utf8', $message ) - } - ); - } else { - %mail = $email->create_message_headers ({ - to => $to, - from => $from, - subject => encode('utf8', $subject ), - message => encode('utf8', $message ) - } - ); + $message = "$message"; + $args->{contenttype} = 'text/html'; } + $args->{message} = $message; + my $email = Koha::Email->new(); + my %mail = $email->create_message_headers($args); $mail{'Auth'} = {user => $username, pass => $password, method => $method} if $username; sendmail(%mail) or carp 'mail not sent:' . $Mail::Sendmail::error; } else { --