Retrieving Email Messages
So far, today's lesson has concentrated on sending email messages, but the JavaMail API provides support for other common email operations, such as retrieving messages and attachments and deleting messages on the server. The remainder of today's lesson gives you an introduction to these operations.
Retrieving Simple Messages
Earlier in today's lesson, you saw that the most prevalent message-retrieval protocols are POP3 and IMAP. The application you are about to build uses POP3 to retrieve messages from a mail server. Note that because you work with an abstraction of a mail system, the technique for accessing a mailbox with IMAP is very similar.
Figure 11.3 shows the process for retrieving messages.