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




message
A Stream object containing message data.
flags
An ImapFlags value representing the flags to set on the message.
internalDate
A System.Datetime representing the internal date to use for the message.
state
User state information.
Begin to add a new message with customized attributes to the mailbox using APPEND.

Syntax

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

Parameters

message
A Stream object containing message data.
flags
An ImapFlags value representing the flags to set on the message.
internalDate
A System.Datetime representing the internal date to use for the message.
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. flags determines which flags are set on the new message. internalDate sets the internal date (the date the message arrived) of the message on the server.

Requirements

Target Platforms: Microsoft .NET Framework 2.0

See Also

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