If
lbrid is encoding his data separately, then that is where the error is.
MIME::Lite handles the encoding itself using
MIME::QuotedPrint, so the data would be encoded twice.
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
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.