X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2FMisc.pm;h=ed4b1032196052ddafcd0303ef817c0341e5ddec;hp=ff5723fd7a3cde18e7bbebe6df38f160ccd402c2;hb=57d4a5ffe7b86d032339d6eefe1a22277f3ca113;hpb=e49ae07876b2f0254875581e525f8aee208ca1d1 diff --git a/FS/FS/Misc.pm b/FS/FS/Misc.pm index ff5723fd7..ed4b10321 100644 --- a/FS/FS/Misc.pm +++ b/FS/FS/Misc.pm @@ -156,7 +156,11 @@ sub send_email { unshift @mimeparts, { 'Type' => ( $options{'content-type'} || 'text/plain' ), - 'Data' => $options{'body'}, + 'Charset' => 'UTF-8', + 'Data' => ( $options{'content-type'} =~ /^text\// + ? Encode::encode_utf8( $options{'body'} ) + : $options{'body'} + ), 'Encoding' => ( $options{'content-type'} ? '-SUGGEST' : '7bit' ), 'Disposition' => 'inline', }; @@ -165,7 +169,10 @@ sub send_email { @mimeargs = ( 'Type' => ( $options{'content-type'} || 'text/plain' ), - 'Data' => $options{'body'}, + 'Data' => ( $options{'content-type'} =~ /^text\// + ? Encode::encode_utf8( $options{'body'} ) + : $options{'body'} + ), 'Encoding' => ( $options{'content-type'} ? '-SUGGEST' : '7bit' ), ); @@ -373,7 +380,7 @@ sub generate_email { 'Type' => 'text/plain', 'Encoding' => 'quoted-printable', #'Encoding' => '7bit', - 'Data' => $data, + 'Data' => Encode::encode_utf8($data), 'Disposition' => 'inline', ); @@ -394,7 +401,7 @@ sub generate_email { ' ', ' ', ' ', - @html_data, + ( map Encode::encode_utf8($_), @html_data ), ' ', '', ],