Breadcrumbs

Moving Emails

You can move messages from one folder to another through calls to methods of the MoveMessage class:

Figure: The MoveMessage Class

java_mail_class_movemessages.png

Moving a Message 

A message can be moved from one folder to another by specifying its ID and calling the moveMessage method:

java_mail_move_message.png

Parameters of method moveMessage in detail:

Name

Type

Direction

Remarks

connection

MailConnection

In

Specifies connection details such as server name, protocol etc. (see Mail Connection).

id

String

In

Id of the message.

fromFolder

String

In

Folder in which the message is located.

toFolder

String

In

Folder to which the message should be moved.

Please note that POP3-Protocol does not support usage of folders. Therefore, the moveMessage will raise an exception if called when using POP3 protocol.