At first glance that looks OK to me. I have attached an example multi-part mime message that seems to work fine with your code. Check the messages that you are feeding in and see if they are really multi-part.
From: Laura Rios <laura@oara.sf.ca.us> To: steve@ntecom.za Subject: Sara is two! Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Snip snip snip" Prologue: any text here is ignored by MIME mail programs --Snip snip snip Content-Type: text/enriched; charset="us-ascii" Hi, Steve. Sara had her second birthday yesterday. Can you believe i +t? She is so <bold>big</bold>! Now if we can just live through the "terrible twos" for a year, <italic>sigh</italic>. Here are a few words from her. I've also scanned in a picture of her party. Tell your boss thanks for letting us keep in touch by email. Laura --Snip snip snip Content-type: audio/basic Content-transfer-encoding: base64 Content-description: Sara says "I love you, Steve" (awww) /Xr++/hoX2lqeXt8d/7z8/D5+PLw7/b+9fD09319/vz5f3j//Pz9fHp7fvrs9Wz/eH59d /////////////////y8= --Snip snip snip Content-type: image/gif Content-transfer-encoding: base64 Content-description: Cutting the cake, sort of R0lGODdhQAHIAKMAAAAAAP+2bQAAACQAAAAASEgAAAAkSEgkJG0kJJEkAABIkZFIJCRttr +Zt l7Vry4B9aM+yKjifMosAADs= --Snip snip snip-- ----END----

In reply to Re: MIME to attach by steer
in thread MIME to attach by nathanvit

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.