in reply to Re: Encoded mailing
in thread Encoded mailing

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

Replies are listed 'Best First'.
Re^3: Encoded mailing
by Ibrid (Initiate) on Aug 22, 2007 at 13:13 UTC
    I Clint, and thanks for your help but I'm still having problems with my email...

    In outlook the header is now OK but I'm receiving the source of the body as content...

    In hotmail, the content (body) is ok but the title look like something like this (éêèà âä )

    And finaly in yahoo I'm not even receiving the email...

    There a lot a documentation about the RFC but not much on the perl side about how to built email using the RFC's standart

      If you give us some actual data and the final code you're using, we can probably help you more. Write a short program that demonstrates the problem (and paste it with <code> tags).

      Clint