You need to read mail.
Use a JavaMail
The JavaMail API is designed to be easy to use.
Store encapsulates the information and access
methods for a particular type of mail storage; the steps for using it
are listed in the sidebar.
Sun provides a
Store class for the
IMAP transport mechanism, and
optionally for POP3. In these examples I use the
Unix mbox protocol (when I started with Unix there was no POP3 protocol; it
was traditional to access your mail spool file directly on a server).
However, you could use all these programs with the POP or IMAP stores
just by passing the appropriate protocol name where
“mbox” appears in the following examples. I’ve
tested several of the programs using Sun’s POP store and
(CUCIpop and PMDF).
I delete most of the email I get on one of my systems, so there were only two messages to be read when I ran my first "mailbox lister” program:
daroad.darwinsys.com$ java MailLister mbox localhost ...