in reply to Re: Encoding for MIME::Lite?
in thread Encoding for MIME::Lite?

here's some more information... my apologies for the multiple replies, I don't see them when I refresh the site...

I have been reading the docs on MIME::Lite. Encoding base64 does not work with multipart/alternative. I also tried using MIME::Base64 but that seemed to confound the output even more.

At least I'm getting the output now in HTML format using MIME::QuotedPrint, but it has = signs and some HTML markup showing (despite it all being escaped in the original). It looks like this (snipped)

Thank you for submitting your school profile to the Core Knowledge Fou +n= dation. You submitted the following data on: Thursday, August 23, +2007 at 1= 2:19:33, server time. = asdf<= tr><= /tr>= <= /tr><= /tr><= /tr> How did you find out about CK? please ignore, testing New = or updated profile? New


here's some of my form script
use MIME::Lite; use MIME::QuotedPrint; # # this part generates $email_body for plain text and $email_html for +html text # $msg = MIME::Lite->new( To =>$email_to, From =>$email_of_sender, Subject =>$email_subject, Type =>'multipart/alternative', ); $msg->attach(Type => 'text/plain', Data => $email_body ); $msg->attach(Type => 'text/html', Data => encode_qp($email_html) ); $msg->send;
thanks for your help!

Replies are listed 'Best First'.
Re^3: Encoding for MIME::Lite?
by clinton (Priest) on Aug 23, 2007 at 19:35 UTC
    Here's the problem:
    $msg->attach( Type => 'text/html', Data => encode_qp($email_html) );

    You're encoding twice. MIME::Lite does that for you - there's no need to call encode_qp yourself.

    Clint

      thanks, Clint!

      I've tried it with use MIME::QuotedPrint;, with Data => $email_html and with and without this line:
      $msg->attr('Encoding' => 'quoted-printable');
      and it still generates this error in both cases:
      A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. The following address(es) faile +d: webmaster@coreknowledge.org SMTP error from remote mail server after end of data: host mail.coreknowledge.org [216.12.92.18]: 500 Line too long


      any guidance you can offer would be AWESOME.

      My old, very deprecated mail-lib.pl never caused this particular problem. :-( but of course it never handled HTML multipart/alternative email, either.
      ---Opally
        I didn't say use MIME::QuotedPrint - I said drop the qp_encode. Set the Encoding to whatever you want as per the docs in MIME::Lite, and the module will handle the encoding for you.

        Clint