All depends on how the mail was first created. You'll need to use IMAP and look at the structure of the mail, break it down into its respective parts and look at each to see if it a message part, attachment.
The fetch header function will give you suprisingly, the headers, (to, from, subject etc)
All encompassed within IMAP.