in reply to Re: Encoded mailing
in thread Encoded mailing
Also, you cannot encode non-ASCII characters in the header using the same techniques as for the data. As specified in RFC 2047: Message Header Extensions for Non-ASCII Text, the headers should be encoded using "B" or "Q" encoding, as handled by Encode::MIME::Header. The Subject, To and From headers should all be encoded with this module, as should any other header which may include non-ASCII characters. So the code should be:
use Encode qw(encode); my $message = "Message with spéciâl characters"; my $msg = MIME::Lite->new( 'From' => encode('MIME-Header',$emailReturn), 'To' => encode('MIME-Header',$email), 'Subject' => encode('MIME-Header',$subject), 'Type' => 'text/html', 'Data' => $message, ); $msg->attr('Encoding' => 'quoted-printable'); $msg->attr('content-type' => 'text/html'); $msg->attr("content-type.charset" => "windows-1252"); $msg->send('smtp', "IP ADRESS", Timeout=>60);
Clint
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Encoded mailing
by Ibrid (Initiate) on Aug 22, 2007 at 13:13 UTC | |
by clinton (Priest) on Aug 22, 2007 at 13:29 UTC |