views:

26

answers:

0

I'm using Zend_Mail_Storage_Imap to retrieve messages. When the code retrieves an email with an attachment it contains 3 parts. The first part's content is the body of the email. The second part's content is the body of the email with some extra whitespace after it. The third part is the base64 attachment.

Why is it showing two parts for the body and why does the second part have extra whitespace?

Will emails with attachments always have the body/plain text or html as the first part, or is it possible that the attachment could be first and the body of the email second?

What is the correct way to determine if a part of an IMAP message is an attachment or is the body of the email?