imap client

HI,

ive implimented smtp mail and its working fine, but…

i want to be able to download new messages from gmail using imap including the attachments.
does anyone have any code i could have a look at please?