Welcome tenny1204,

I'm not familiar with Net::IMAP:Client, but I have written a full email package in Perl for a web mail system, and that series of packages took 2+ years to develop and I already had 10+ years working with email and Perl. I recommend that you get a copy of an O'Reilly book called "Programming Internet Email" written by David Wood. I got my copy used, but it was a great help in answering so many basic/advanced email questions. The most important part is that the examples are written in Perl (and Java), and Perl is what I needed. Also what helped me was the explanation of the terms and the rules for building a RFC compliant email.

Now I'm going to guess how to help you.

Once you use MIME, the format of the email document changes. Every part of the email is now controlled by '"Content-Type: ... boundary="..."'. Even the Capitalization of words used in the headers is mandatory.

Now guessing, the parts of the "body" (which could be a series of nested multi-part messages) needs to be encoded without the headers and the headers have to be separated by two "\r\n" before and after the encoded message. So you need to make sure the boundary headers are not part of the encoded document.

I use the free Mozilla Thunderbird and if you display a MIME email and then type '^U' (control U), you will see how the raw email is received by Thunderbird. This can help you determine if your generated email looks like the one generated by Thunderbird. I found other clients show the translated email and not the raw input.

Good Luck...Ed

"Well done is better than well said." - Benjamin Franklin


In reply to Re: decoding email attachments. by flexvault
in thread decoding email attachments. by tenny1204

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.