]> wagnertech.de Git - mfinanz.git/blobdiff - SL/Mailer/Sendmail.pm
Merge branch 'master' of vc.linet-services.de:public/lx-office-erp
[mfinanz.git] / SL / Mailer / Sendmail.pm
index 6b24ecdb5f134211fd52c5af65256399bfd13c67..ea1e63b8a214e384143b71b330cda75655e569bb 100644 (file)
@@ -2,6 +2,7 @@ package SL::Mailer::Sendmail;
 
 use strict;
 
+use Encode;
 use IO::File;
 use SL::Template;
 
@@ -17,7 +18,7 @@ sub init {
 
   Rose::Object::init(@_);
 
-  my $email         =  $self->mailer->recode($self->myconfig->{email});
+  my $email         =  $::locale->is_utf8 ? Encode::encode('utf-8', $self->myconfig->{email}) : $self->myconfig->{email};
   $email            =~ s/[^\w\.\-\+=@]//ig;
 
   my %temp_form     = ( %{ $self->form }, myconfig_email => $email );
@@ -26,6 +27,7 @@ sub init {
   $sendmail         = $template->parse_block($sendmail);
 
   $self->{sendmail} = IO::File->new("|$sendmail") || die "sendmail($sendmail): $!";
+  $self->{sendmail}->binmode(':utf8') if $::locale->is_utf8;
 }
 
 sub start_mail {