Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space WBRIDGE and version 24.0

Otp

Class ReadMessages provides methods for reading messages from the inbox or from arbitrary folders on the server. In addition, in case of multipart/multi-content messages, the messages are parsed and the content and/or attachments are returned in appropriate array attributes of the Mail class. This behavior is useful in most cases, but not always. For scenarios that require access to raw (unparsed) content of the message, you should use class ReadRawTextMessages.

Figure: The ReadRawTextMessages Class

JavaMail_ReadRawTextMessagesImage Modified

All methods of ReadRawTextmessages return an Array of RawTextMessage objects:

JavaMail_RawTextMessageImage Modified

The RawTextMail class contains all attributes from Mail and MailEnvelope classes and adds an attribute for the raw message text as an instance of Blob.

Reading Specific Raw Text Messages Using Retrieval Constraints

You can specify which raw text messages to retrieve by providing a constraints object to the readRawTextMessagesWithConstraints method:

Image Modified

Parameters of method readMessagesWithConstraints in detail:

NameTypeDirectionDescription
connectionMailConnectionIn
Multiexcerpt include
MultiExcerptNameconnection
nopaneltrue
PageWithExcerptReading Messages
constraintsRetrievalConstraintsIn
Multiexcerpt include
MultiExcerptNameRetrievalConstraints
nopaneltrue
PageWithExcerptReading Messages
returnArray of RawTextMailReturnAn array containing emails matching the constraints, or an empty array, if no emails were found.

Reading All Raw Text Messages from the Inbox

To read all raw text messages from the inbox, use the readRawTextMessages method:

JavaMail_ReadRawTextMessages_readRawTextMessagesImage Modified

Parameters of method readRawTextMessages in detail:

Name
Type
Direction
Description
connectionMailConnectionIn
Multiexcerpt include
MultiExcerptNameconnection
nopaneltrue
PageWithExcerptReading Messages
deleteOnServerBooleanIn
Multiexcerpt include
MultiExcerptNamedeleteonserver
nopaneltrue
PageWithExcerptReading Messages
returnArray of RawTextMailReturnAn array containing emails from the inbox folder with the corresponding message id, or an empty array, if no emails were found.

Reading Raw Text Messages from Inbox Folder by Id

The method readRawTextMessagesById provides the means to read a message from the inbox folder by specifying the message id:

JavaMail_ReadRawTextMessages_readRawTextMessagesByIdImage Modified

Name
Type
Direction
Description
connectionMailConnectionIn
Multiexcerpt include
MultiExcerptNameconnection
nopaneltrue
PageWithExcerptReading Messages
idStringInId of the message
returnArray of RawTextMailReturnAn array containing emails from the inbox folder with the corresponding message id, or an empty array, if no emails were found.

Reading Raw Text Messages from Arbitrary Folders

You can use the readRawTextMessagesByFolder method to read raw text messages from arbitrary folders on the mail server:

JavaMail_ReadRawTextMessages_readRawTextMessagesByFolderImage Modified

Name
Type
Direction
Description
connectionMailConnectionIn
Multiexcerpt include
MultiExcerptNameconnection
nopaneltrue
PageWithExcerptReading Messages
deleteOnServerBooleanIn
Multiexcerpt include
MultiExcerptNamedeleteonserver
nopaneltrue
PageWithExcerptReading Messages
folderStringInName of the folder to read.
returnArray of RawTextMailReturnAn array containing emails from the inbox folder with the corresponding message id, or an empty array, if no emails were found.
Panel
titleOn this Page:
Table of Contents