| Visual Basic (Declaration) | |
|---|---|
Public Function GetPart( _ ByVal part As Stream, _ ByVal peek As Boolean _ ) As Stream | |
| Visual Basic (Usage) | Copy Code |
|---|---|
Dim instance As ImapMessage Dim part As Stream Dim peek As Boolean Dim value As Stream value = instance.GetPart(part, peek) | |
Parameters
- part
- The part of the message to retrieve.
- peek
- Determines whether or not to mark the message as Seen when retrieving the part.
Return Value
The Stream containing the data for the specified part.| 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. |
The ImapMessage.GetPart method gets a single part of the message. part must be an object from the MessageStream.Parts collection of the message. The component retrieves only the portion of the message represented by part and populates the content for this object. This is useful for allowing developers to download an attachment associated with a message without downloading the message itself.
Typically, before using this method, developers will need to use ImapMessage.GetOutline or ImapMessage.BeginGetOutline, which creates a MessageStream object with Part objects (containing no data) representing the parts contained within the message. The developer can then pass the Part object they would like to retrieve into the ImapMessage.GetPart method.
peek indicates whether this operation should mark the message as seen; if peek is true, then the Seen flag will not be changed. If peek is false, the Seen flag will be set to true.
Target Platforms: Microsoft .NET Framework 2.0