| Visual Basic (Declaration) | |
|---|---|
Public Overloads Function BeginCopy( _ ByVal first As ImapMessage, _ ByVal last As ImapMessage, _ ByVal destination As Mailbox, _ ByVal state As Object _ ) As IAsyncResult | |
| Visual Basic (Usage) | Copy Code |
|---|---|
Dim instance As Mailbox Dim first As ImapMessage Dim last As ImapMessage Dim destination As Mailbox Dim state As Object Dim value As IAsyncResult value = instance.BeginCopy(first, last, destination, state) | |
| C# | |
|---|---|
public IAsyncResult BeginCopy( ImapMessage first, ImapMessage last, Mailbox destination, object state ) | |
| Managed Extensions for C++ | |
|---|---|
public: IAsyncResult* BeginCopy( ImapMessage* first, ImapMessage* last, Mailbox* destination, Object* state ) | |
| C++/CLI | |
|---|---|
public: IAsyncResult^ BeginCopy( ImapMessage^ first, ImapMessage^ last, Mailbox^ destination, Object^ state ) | |
Parameters
- first
- An ImapMessage object representing the first message in the range to copy.
- last
- An ImapMessage object representing the last message in the range to copy.
- destination
- The name of the destination mailbox.
- state
- User state information.
Return Value
An IAsyncResult that represents the asynchronous operation, which could still be pending.| Exception | Description |
|---|---|
| Dart.PowerTCP.Mail.ProtocolException | Bad IMAP protocol response received from server. |
| System.Net.Sockets.SocketException | The requested address is not valid in its context. |
| System.InvalidOperationException | BeginXXX method used without providing an EndXXX event handler. |
| System.ArgumentOutOfRangeException | index was out of range |
| System.IndexOutOfRangeException | index was outside bounds of array |
| Dart.PowerTCP.Mail.InvalidParameterTypeException | Collection contains instances of wrong type of object |
The Mailbox.BeginCopy method begins to asynchronously copy the messages contained within the range specified by first and last to the specified destination. Upon completion, the Imap.EndCopy event is raised. This command results in an IMAP COPY command being issued to the server for each message. The command uses the UIDs of the messages to perform the copy operation. The ImapMessages in messages must be in this mailbox.
This method is useful for bulk operations. If you would like to copy a single message, use the ImapMessage.CopyTo method of the ImapMessage object.
Target Platforms: Microsoft .NET Framework 2.0