title: Failing to parse this multi-part mime message body in Java
body: <p>I'm not writing a mail application, so I don't have access to all the headers and such.  All I have is something like the block at the end of this question.  I've tried using the JavaMail API to parse this, using something like</p>
  
  <pre><code>Session s = Session.getDefaultInstance(new Properties());
  InputStream is = new ByteArrayInputStream(&lt;&lt; String to parse &gt;&gt;);
  MimeMessage message = new MimeMessage(s, is);
  Multipart multipart = (Multipart) message.getContent();
  </code></pre>
  
  <p>But, it just tells me that message.getContent is a String, not a Multipart or MimeMultipart.  Plus, I don't really need all the overhead of the whole JavaMail API, I just need to parse the text into it's parts.  Here's an example:</p>
  
  <pre>
  This is a multi-part message in MIME format.\n\n------=_NextPart_000_005D_01CC73D5.3BA43FB0\nContent-Type: text/plain;\n\tcharset="iso-8859-1"\nContent-Transfer-Encoding: quoted-printable\n\nStuff:\n\n            Please read this stuff at the beginning of each week.  =\nFeel free to discuss it throughout the week.\n\n\n--=20\n\nMrs. Suzy M. Smith\n555-555-5555\nsuzy@suzy.com\n------=_NextPart_000_005D_01CC73D5.3BA43FB0\nContent-Type: text/html;\n\tcharset="iso-8859-1"\nContent-Transfer-Encoding: quoted-printable\n\n\n\n\n\n\n\n\n\nStuff:</P>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20\nPlease read this stuff at the beginning of each =\nweek.&nbsp; Feel=20\nfree to discuss it throughout the week.</P>\n<BR>-- <BR><BR>Mrs. Suzy M. Smith<BR>555-555-5555<BR>suzy@suzy.com\n\n------=_NextPart_000_005D_01CC73D5.3BA43FB0--\n\n
  </pre>