IMAP Backup and Restore Operation

Aspose.Email for .NET provides the ability to backup and restore messages. For this, the API provides the following methods.

This article demonstrates how to backup and restore messages using the ImapClient class.

Backup Messages

To backup messages, use the ImapClient.Backup method as demonstrated in the following code snippet.

Restore Messages

To restore messages, use the ImapClient.Restore method as demonstrated in the following code snippet.

IMAP Backup and Restore Operation with MultiConnection

When working with a large number of messages, the backup/restore operation can take a long time. For this, the API provides support for multiple connections during backup and restore operation. To enable the MultiConnection mode, set ImapClient.UseMultiConnection property to MultiConnectionMode.Enable. The following code snippets demonstrate backup and restore operation with MultiConnection mode enabled.

Backup Messages with MultiConnection

The following code snippets demonstrate backup operation with MultiConnection mode enabled.

Restore Messages with MultiConnection

The following code snippets demonstrate restore operation with MultiConnection mode enabled.