Add MAPI_FORCE_DOWNLOAD to MAPILogon flags to to download messages before returning.
Using the Outlook Express with rules applied to incoming messages moving them to folders other than Inbox folder, you have no chance to reach these messages through this code. Not to my knowledge, to say more precisely.
Attachments are not processed in this example (MAPI_SUPPRESS_ATTACH flag). Using MAPI_PEEK flag ensures that MAPIReadMail does not mark the messages as read.
Code for retrieving name and address for the recipient is not included. The routine is quite similar to the retrieving parameters for the sender (origin).
If you are not able to logon, try use your messaging system profile name as a parameter. e.g. "Novell Default Settings".
* * *
Each time the MAPIReadMail called without applying the MAPI_SUPPRESS_ATTACH flag, all attachments to messages in Inbox folder are copied to temp files. Continuous trying may seriously deplete the hard drive free space. Actually the MSDN suggests those temp files to be deleted once they are no longer needed.
Credits: PHP (4.4.9), an HTML-embedded scripting language,
MySQL (5.1.55-log), the Open Source standard SQL database,
Version 4, freeware HTML Editor of choice. Hosted by Korax Online Inc.