Move Messages from One Folder to Another using WebDav

You can move email messages from one folder to another with the help of the ExchangeClient.moveMessage() method. It takes the parameters:

  • The unique URI of the message which is to be moved.
  • The unique URI of the destination folder.

Move Messages between Folders

The sample code below that moves a message in a mailbox from the Inbox folder to a folder called Processed. In this example, the application:

  1. Reads messages from the Inbox folder.
  2. Processes some of the messages based on some criteria (in this example, we find a keyword in the message subject).
  3. Moves messages which fulfill the given condition to the Processed folder.