Dart Smtp, Pop, Imap Controls
Get Method
Specifies the message part or attribute to be retrieved. Defaults to msgContent.
Specifies the message numbers to get. The default is all messages.
Optional String specifying the (local) destination file name, or an undimensioned String or Byte array that will be dynamically expanded and filled with a single message. If not specified or NULL, the Messages property will be used as the destination. This parameter is ignored unless Part is msgContent and MsgSet designates a single message.
Description
Get all or part of one or more messages.
Syntax
Visual Basic
Public Sub Get( _
   Optional ByVal Part As PartConstants = msgContent, _
   Optional ByVal MsgSet As String, _
   Optional ByRef Msg As Variant _
) 
Parameters
Part
ValueDescription
msgContentRequests the retrieval of the complete message for each message in MsgSet.
msgPreviewRequests the message header followed by 'n' lines, where 'n' is the value of the Preview property.
msgSizeRequests the size for each message specified in MsgSet.
msgUidlRequests the message UID label for each message in MsgSet.
Specifies the message part or attribute to be retrieved. Defaults to msgContent.
MsgSet
Specifies the message numbers to get. The default is all messages.
Msg
Optional String specifying the (local) destination file name, or an undimensioned String or Byte array that will be dynamically expanded and filled with a single message. If not specified or NULL, the Messages property will be used as the destination. This parameter is ignored unless Part is msgContent and MsgSet designates a single message.
Remarks

This method makes it easy to download any or all parts of a set of messages. The default destination for messages is the Messages property.

If provided, MsgSet specifies one or more message numbers in the range from 1 to Count. Each number should be separated with a comma. A range of numbers may be indicated with a lower and upper number separated with a colon. For example, a message set of "1, 5:7, 12" will retrieve 5 messages: 1, 5, 6, 7, and 12. The POP protocol does support any other criteria for downloading messages.

If the destination is the Messages Collection, this method creates all required Message Objects. If a Message Object exists with the same Attribute(msgNumber) property, it is reused. Therefore, you can first get the Size of messages causing creation of a Message object for each message. Getting the msgContent reuses the Message Objects previously created.

To discover what messages have arrived since the last download, save the number of messages in the mailbox at the end of each session. When you return, the mailbox may have more messages that you can reference by number. Alternatively, use Part=msgUidl. This creates a collection of Message Objects with the Attribute(msgNumber) property initialized to the UID of each message. Then set MsgSet to all the message numbers with UIDs that you have not yet downloaded.

If Msg is specified, MsgSet must reference a single message. If Msg is a buffer and Timeout is 0 (non-blocking), Msg must not go out of scope while the operation completes (the Msg String or Byte array should be global in scope).

If you use the Delete method to mark a message for deletion, and you subsequently include this message in MsgSet, then the ptInvalidParam2 error is generated. If a message is "marked for delete", and MsgSet is not specified (all messages are to be retrieved), then messages "marked for delete" are skipped, protecting you from a server error.

Error Codes

This method may generate the following error code (refer to MailErrorConstants for a complete list of error codes):

See Also

Pop Object  | Pop Members


PowerTCP Mail for ActiveX Documentation Version 2.13
© 2018 Dart Communications. All Rights Reserved.
Send comments on this topic