public static class Message extends Object
Message implements the Part interface. Message contains a set of attributes and a "content". Messages within a folder also have a set of flags that describe its state within the folder.
Message defines some new attributes in addition to those defined
in the Part
interface. These attributes specify meta-data
for the message - i.e., addressing and descriptive information about
the message.
Message objects are obtained either from a Folder or by constructing a new Message object of the appropriate subclass. Messages that have been received are normally retrieved from a folder named "INBOX".
A Message object obtained from a folder is just a lightweight
reference to the actual message. The Message is 'lazily' filled
up (on demand) when each item is requested from the message. Note
that certain folder implementations may return Message objects that
are pre-filled with certain user-specified items.
To send a message, an appropriate subclass of Message (e.g.,
MimeMessage) is instantiated, the attributes and content are
filled in, and the message is sent using the Transport.send
method.
Part
,
Serialized FormCopyright © 2018 Oracle. All rights reserved.