I have setup an IMAP mailbox on my S60 phone. Now I want to programmatically get the emails on my phone and write it to a file. I would want to get the subject and body text of all the emails on my phone. Is there a way to do it. The messaging architecture documentation is hard to understand and use.

Edit: I write Symbian applications using the Carbide.C++ version 1.3 IDE

Please help.