PowerTCP Mail for .NET
GetPart Method
See Also  Send comments on this topic.
Dart.PowerTCP.Mail Namespace > ImapMessage Class : GetPart Method




part
The part of the message to retrieve.
peek
Determines whether or not to mark the message as Seen when retrieving the part.
Gets a single part of the message.

Syntax

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)
C# 
public Stream GetPart( 
   Stream part,
   bool peek
)
Managed Extensions for C++ 
public: Stream* GetPart( 
   Stream* part,
   bool peek
) 
C++/CLI 
public:
Stream^ GetPart( 
   Stream^ part,
   bool 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.

Exceptions

ExceptionDescription
Dart.PowerTCP.Mail.ProtocolExceptionBad IMAP protocol response received from server.
System.Net.Sockets.SocketExceptionThe requested address is not valid in its context.

Remarks

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.

Requirements

Target Platforms: Microsoft .NET Framework 2.0

See Also

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