[rt-users] RE: encoding of the email subject

Ruslan U. Zakirov cubic at acronis.ru
Mon Jul 12 14:06:41 EDT 2004


Dimitry Faynerman wrote:
> Nobody can help me with that???
Broken? In which way? Corrupted? Is it in B or in Q MIME headers 
encoding or it's not encoded at all?

IMHO It's not RT. Try next
require Encode;
my $entity = MIME::Entity->build( ...
...
Subject => Encode::encode("MIME-B", loc(...) ),
...

> 
> 
> 
> -----Original Message-----
> From: Dimitry Faynerman [mailto:dimitry.faynerman at hypermediasystems.com] 
> Sent: Thursday, July 08, 2004 7:21 AM
> To: 'rt-users at lists.bestpractical.com'
> Subject: encoding of the email subject
> 
> Hello,
> 
> I wrote a script for sending an email for password retrieval. Since the user
> is not logged in RT when this email is being sent, I have to do some stuff
> manually (which normally RT is doing for me). So I use something like this:
> 
> ===============================================================
> my $template = RT::Template->new( $self->CurrentUser );
> $template->LoadGlobalTemplate('Password Change');
> 
> my $parsed = $template->_ParseContent();
> 
> my $entity = MIME::Entity->build(
>                                From => $from,
>                                To => $email,
>                                'X-RT-Loop-Prevention' => $RT::rtname,
>                                Type => "text/plain",
>                                Charset => "utf-8",
>                                Subject => loc("Trouble Ticket New
> Password"),
>                                Data => [$parsed]
>                                );
> 
> RT::I18N::SetMIMEEntityToEncoding( $entity, $RT::EmailOutputEncoding,
> 'mime_words_ok' );
> open (MAIL, "|$RT::SendmailPath $RT::SendmailArguments") || return(0);
> print MAIL $entity->as_string;
> close(MAIL);
> ===============================================================
> 
> 
> The problem is that even tough the email body has the correct encoding
> (shift-jis in my case), the email subject is still broken. I tried many
> tricks but had no luck. 
> Could anybody tell me what I'm doing wrong?
> 
> Thanks!
> 
> Dimitry
> 
> 
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
> 
> Be sure to check out the RT wiki at http://wiki.bestpractical.com




More information about the rt-users mailing list