in reply to Re: Send latin1 email with MIME::Lite
in thread Send latin1 email with MIME::Lite

Ok, I see, but if I do something like this:

my $msg = MIME::Lite->new( From => 'test@test.com', To => 'test@test.com', Subject => Mail::Message::Field::Full->new(charset => 'iso-8859-1 +')->encode('!Hey‘ This is a αινσϊδλοφόρΡ mail!'), Type => 'text/html', Encoding => 'quoted-printable' Data => q{ <h1>αινσϊδλοφόρΡ</h1> } ); $msg->attr('content-type.charset' => 'ISO-8859-1' ); $msg->send;

still not work becouse encode the subject to us-ascii.

And the main question, can MIME::Lite do this automatically?

Thank you so much

Replies are listed 'Best First'.
Re^3: Send latin1 email with MIME::Lite
by zwon (Abbot) on Jan 28, 2009 at 18:38 UTC

      Thank, but i'll try to find the solution with the another method becouse i won't include many modules.

      Thank you

        Then you can just extract encoding function from this module. Here's the example that encodes header into Base64:

        use strict; use warnings; use utf8; use Encode; use MIME::Base64; sub encode_header { '=?ISO-8859-1?=' . encode_base64( encode('iso-8859-1', shift), '' +) . '?='; } print encode_header("!Hey‘ This is a αινσϊδλοφόρΡ mail!");

        Note, that Encode is a standard module, and you need MIME::Base64 to use Mail::Message::Field::Full anyway.