[interchange] Encode the text before passing it to MIME::Lite

Stefan Hornburg interchange-cvs at icdevgroup.org
Mon Feb 24 18:34:22 UTC 2014


commit b99053fee99ead7a31eab7ab17d542b81c4ac8ce
Author: Marco Pessotto <melmothx at gmail.com>
Date:   Mon Feb 24 14:20:40 2014 +0100

    Encode the text before passing it to MIME::Lite
    
    It looks like MIME::Lite wants octects. The documentation is not
    clear, expecially because we are asked to specify an encoding.
    
    Actually, the Encoding of the attachement is the *Transfer-Encoding*,
    not the actual encoding of the part.
    
    From the doc:
    
    Encoding
    
        Optional. The content transfer encoding that should be used to encode your data:

 code/UserTag/email.tag |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/code/UserTag/email.tag b/code/UserTag/email.tag
index d1756ac..c4361d3 100644
--- a/code/UserTag/email.tag
+++ b/code/UserTag/email.tag
@@ -147,7 +147,7 @@ sub {
             $msg->attach(
                          Type => $opt->{body_mime},
                          Encoding => $opt->{body_encoding},
-                         Data => $body,
+                         Data => ($utf8 ? utf8_to_other($body, 'utf-8') : $body),
                          Disposition => $opt->{body_disposition} || 'inline',
                          Format => $opt->{body_format} || $att1_format,
                         );



More information about the interchange-cvs mailing list