Getting number of Read/Unread mails

Hi All,

We have a Java based screen from where user logs in to the their Notes web mail and other applications. In this screen, we want to show a user total number mails and number of unread mails in their mailbox, similar to any other mailing site.

Is there any backend method (Script, API) to get this detail from a user mail box. I have tried using Notes method (unprocessed documents) but this to work, it needs some view or folder to be selected.

Thanks for any input in this regard.

Jagbandhu Singh