It's because your mail is MIME encoded in multiple parts. For instance it could contain HTML and plain text and propably attachments too.
You need to detect if it's MIME and then decode it into the different parts.
Dunno if it's in the API as I'm at work and can't look it up, but it's probably there
Hope it helps