PowerTCP Mail for .NET
BeginCopy(ICollection,Mailbox,Object) Method
See Also  Send comments on this topic.
Dart.PowerTCP.Mail Namespace > Mailbox Class > BeginCopy Method : BeginCopy(ICollection,Mailbox,Object) Method




messages
A collection of ImapMessage objects representing the messages to copy.
destination
The name of the destination mailbox.
state
User state information.
Begins to asynchronously copy the specified messages to the specified mailbox.

Syntax

Visual Basic (Declaration) 
Public Overloads Function BeginCopy( _
   ByVal messages As ICollection, _
   ByVal destination As Mailbox, _
   ByVal state As Object _
) As IAsyncResult
Visual Basic (Usage)Copy Code
Dim instance As Mailbox
Dim messages As ICollection
Dim destination As Mailbox
Dim state As Object
Dim value As IAsyncResult
 
value = instance.BeginCopy(messages, destination, state)
C# 
public IAsyncResult BeginCopy( 
   ICollection messages,
   Mailbox destination,
   object state
)
Managed Extensions for C++ 
public: IAsyncResult* BeginCopy( 
   ICollection* messages,
   Mailbox* destination,
   Object* state
) 
C++/CLI 
public:
IAsyncResult^ BeginCopy( 
   ICollection^ messages,
   Mailbox^ destination,
   Object^ state
) 

Parameters

messages
A collection of ImapMessage objects representing the messages 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.

Exceptions

ExceptionDescription
Dart.PowerTCP.Mail.ProtocolExceptionBad IMAP protocol response received from server.
System.Net.Sockets.SocketExceptionThe requested address is not valid in its context.
System.InvalidOperationExceptionBeginXXX method used without providing an EndXXX event handler.
System.ArgumentOutOfRangeExceptionindex was out of range
System.IndexOutOfRangeExceptionindex was outside bounds of array
Dart.PowerTCP.Mail.InvalidParameterTypeExceptionCollection contains instances of wrong type of object

Remarks

The Mailbox.BeginCopy method begins to asynchronously copy the messages contained within the collection messages 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.

Requirements

Target Platforms: Microsoft .NET Framework 2.0

See Also

Documentation Version 3.2
© 2010 Dart Communications. All Rights Reserved.