Move Email to a Folder on Microsoft Exchange Server in Java

Aspose.Email for Java allows you to work with Microsoft Exchange Server’s services such as email, contact management, calendaring, etc. In a previous post, you have seen how to read emails from MS Exchange Server programmatically from within your Java applications. However, in certain cases, you may have to move emails from one folder to another on Exchange Server. In this article, you will learn how to move emails to a particular folder on MS Exchange Server in java.

Java API to Move Emails on Microsoft Exchange Server

Aspose.Email for Java is a powerful email API to work with MS Exchange Server without writing complex code. In this article, we will use this API to move emails to a specific folder of the mailbox in MS Exchange Server. You can either download the API or install it using the following Maven configurations.

Repository:

<repository>
    <id>AsposeJavaAPI</id>
    <name>Aspose Java API</name>
    <url>http://repository.aspose.com/repo/</url>
</repository>

Dependency:

<dependency>
    <groupId>com.aspose</groupId>
    <artifactId>aspose-email</artifactId>
    <version>22.2</version>
    <classifier>jdk16</classifier>
</dependency>

Move Email to a Folder on MS Exchange Server in Java

The following are the steps to move emails to a particular folder on MS Exchange Server in Java.

The following code sample shows how to move an email to a folder on MS Exchange Server in Java.

Move New Email to a Folder on MS Exchange Server

You can also move a newly created email to a particular folder in MS Exchange Server. The following are the steps to perform this operation.

The following code sample shows how to move a new email message to a folder in MS Exchange Server.

Get a Free API License

You can get a free temporary license to use Aspose.Email for Java without evaluation limitations.

Conclusion

In this article, you have learned how to move emails to a particular folder in Microsoft Exchange Server using Java. Furthermore, you have seen how to move a newly created email message to a specific folder in Exchange Server. Besides, you can explore the documentation to read more about Aspose.Email for Java. Also, you can ask your questions via our forum.

See Also