PowerTCP Mail for .NET
BeginAdd(Stream,Object) Method
See Also  Send comments on this topic.
Dart.PowerTCP.Mail Namespace > ImapMessageCollection Class > BeginAdd Method : BeginAdd(Stream,Object) Method




message
A Stream object containing message data.
state
User state information.
Begin to add a new message to the mailbox using APPEND.

Syntax

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

Parameters

message
A Stream object containing message data.
state
User state information.

Return Value

An IAsyncResult that represents the asynchronous operation, which could still be pending.

Exceptions

ExceptionDescription
System.InvalidOperationExceptionBeginXXX method used without providing an EndXXX event handler.
Dart.PowerTCP.Mail.ProtocolExceptionBad IMAP protocol response received from server.
System.Net.Sockets.SocketExceptionThe requested address is not valid in its context.

Remarks

Using the ImapMessageCollection.BeginAdd method causes an APPEND command to be asynchronously sent to the IMAP server, adding the message contained in message to the mailbox represented by Imap.CurrentMailbox. When this method completes, the Imap.EndMessageAdd event will be raised. Typically, message will be a MessageStream object, but can be any Stream object.

Requirements

Target Platforms: Microsoft .NET Framework 2.0

See Also

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