I'm having a little trouble figuring out these IMAP functions. I got them compiled and working, I just can't figure out how to use them properly.
I'm able to connect to a mailbox, create a list of UIDs, loop through that list and get all of the envelope information for each email. But I'm having trouble with the bodies.
What I want is to read the text/plain part of each email, unless the email is not a multi-part message, then I'll take the whole body.
I can get the whole body easily enough, but I can't figure out how to check to see if an email is multipart or not, and I can't figure out how to properly select the text/plain portion and only the text/plain portion of an email.