I ran the code that you posted but I can only get it to take a mime message and write a txt file with the same exact content. What am I doing wrong. I am pasting the test message below that I am passing it. It has text, html, and an attachment sent from netscape messenger. The function isn't recursing. $entity->parts always equals 0 Thanks for your help.

This is a multi-part message in MIME format.
--------------B8A046EFF7EDB5DE9549664F
Content-Type: multipart/alternative;
boundary="------------12FC523FDAD8D46FC3E99678"


--------------12FC523FDAD8D46FC3E99678
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

this is a test of the attachment functionality.



--
Thanks,
Kenny



--------------12FC523FDAD8D46FC3E99678
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
this is a test of the attachment functionality.
<br>
<br>
<pre>--
Thanks,
Kenny

</html>

--------------12FC523FDAD8D46FC3E99678--

--------------B8A046EFF7EDB5DE9549664F
Content-Type: application/x-gzip;
name="investing.tar.gz"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="investing.tar.gz"

H4sICDprSzsAA2ludmVzdGluZy50YXIA7dLBisIwEAbgXO1TzGEPekiZSWNjBR8mi6kURaWN
wr79puKW3YWiHkSE/7sMZH4mgUyzP4cuNvuNeh4W5rK0ihPn5E/tWS4Vu4KdOGf6czHWFor4
iW8anLroWyJ1/PIxbsdzt/pvSkRLqU36BdJk5vmlfpi8qmgaW78OVIcwy9hosX1MUnvOozGr
ufiJjU/LVnfJ4iH6HTWXFQ1r+gz1oQ00DFpSWqx0x/+cr2Nof8eokpwLuuaGRrecTGiRVy57
9S8AAAAAAAAAAAAAAAAAAAAAAAA87huu6CnZACgAAA==
--------------B8A046EFF7EDB5DE9549664F--

-- rogueFalcon

Why do you people insist on doing things sdrawkcab?


In reply to Re: Receiving an email attachment by rogueFalcon
in thread Receiving an email attachment by rogueFalcon

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.