Java Reference
In-Depth Information
To: eharold@utopia.poly.edu
Subject: Breath RX Products now available Online!
Sent: Wed Dec 02 03:45:52 PST 2009
Notice that none of these messages have received dates. That's because the receive time
is not part of the message envelope itself. It has to be provided by the server, and POP
servers don't provide it. An IMAP server would be much more likely to include a re‐
ceived date, as will be shown in Example 7-2 .
Flags
Mail programs can save extra information about the messages that are not part of the
messages themselves. For instance, Pine lets me know whether I've replied to or read a
message, and so on. As Figure 7-1 shows, this information is indicated by symbols and
letters in the lefthand column. D means a message has been deleted; A means it's been
answered; N is a new message that hasn't been read yet; and so forth. In the JavaMail
API, these are all represented as flags . A flag is an instance of the javax.mail.Flags
class:
public class Flags extends Object implements Cloneable
Seven flags are predefined as instances of the public static inner class Flags.Flag . These
are:
Flags . Flag . ANSWERED
Flags . Flag . DELETED
Flags . Flag . DRAFT
Flags . Flag . FLAGGED
Flags . Flag . RECENT
Flags . Flag . SEEN
Flags . Flag . USER
In addition, some implementations may allow arbitrary user-defined flags. If so, the
USER flag is set.
Figure 7-1. Pine shows flags as letters in the lefthand column
 
Search WWH ::




Custom Search