One of the reasons for getting count of 0 as I have observed while coding is " The mailbox delivery location could be set to Pst". So there will be no mails left in the Exchange Server Mailbox.
Otherwise try creating a profile first and then run the program. I am not sure of the returned value of Session variable of the MapiLogonEx when a new profile is created during logon.
Let me know if you are able to solve ur problem with this.
Muthu
|