Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Encoding for MIME::Lite?

by clinton (Priest)
on Aug 23, 2007 at 18:45 UTC ( [id://634707]=note: print w/replies, xml ) Need Help??


in reply to Encoding for MIME::Lite?

From the MIME::Lite docs about Encoding:
base64 Like "uuencode", but very well-defined. This is how you should send essentially binary information (tar files, GIFs, JPEGs, etc.).

Have a read of the section in the docs called A MIME PRIMER

Clint

Replies are listed 'Best First'.
Re^2: Encoding for MIME::Lite?
by Opally (Initiate) on Aug 23, 2007 at 19:31 UTC
    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!
      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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://634707]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (2)
As of 2024-04-19 19:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found