| 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.| Exception | Description |
|---|---|
| System.InvalidOperationException | BeginXXX method used without providing an EndXXX event handler. |
| Dart.PowerTCP.Mail.ProtocolException | Bad IMAP protocol response received from server. |
| System.Net.Sockets.SocketException | The requested address is not valid in its context. |
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.
Target Platforms: Microsoft .NET Framework 2.0