IMAP_MsgLst

4D - Documentation   Français   English   German   Japanese   4D Internet Commands, Theme List   4D Internet Commands, Alphabetical List   Back   Previous   Next

version 6.8.1


IMAP_MsgLst (imap_ID; startMsg; endMsg; msgHeaderArray; msgNumArray; msgIdArray; msgValueArray) Integer

ParameterTypeDescription
imap_IDLongintReference to an IMAP login
startMsgLongintStart message number
endMsgLongintEnd message number
msgHeaderArrayStr | Txt ArrayArray of headers to retrieve
msgNumArrayLongint ArrayArray of message numbers
msgIdArrayLongint ArrayArray of Unique Msg IDs
msgValueArray2D Str|Txt Array2D Array of header values
Function resultIntegerError code

Description

The IMAP_MsgLst command is used to get specific information of mailbox contents. It allows the user to request specific columns of the message list. This command can only return header item values; it cannot be used to retrieve the body of a message. Header content is automatically decoded and converted if needed (see POP3_Charset for more information concerning the decoding and conversions rules).

imap_ID is a long integer reference to an open connection created with IMAP_Login.

startMsg is a long integer number that specifies the starting message number of the message range to be examined. The message number is a value representing the position of a message within the list of all messages in the current working mailbox.

endMsg is a long integer number that specifies the ending message number of the message range to be examined. The message number is a value representing the position of a message within the list of all messages in the current working mailbox.

Note: The IMAP_Delete, IMAP_MsgLstInfo, IMAP_MsgLst, IMAP_SetFlags, IMAP_GetFlags and IMAP_CopyToMB commands do not return an error if the startMsg is greater than the endMsg. In the event that this occurs, the command – in effect – does nothing.

msgHeaderArray is a string or text array that lists the specific e-mail headers you wish to retrieve.

msgNumArray is a long integer array returned containing the message numbers between startMsg and endMsg.

msgIdArray is a long integer array returning the Unique IDs of the messages between startMsg and endMsg.

msgValueArray is a 2-dimensional array that receives the data for each header specified in msgHeaderArray. Each requested header will have a matching array in the first dimension of valueArray.

Example

   aHeaders{1}:="Date:"
   aHeaders{2}:="From:"
   aHeaders{3}:="Subject:"
   IMAP_MsgLst (IMAP_ID;vStart;vEnd;aHeaders;aMsgNum;aMsgId;aValues)

aValues{1}{1} may equal "Thu, 19 November 1998 00:24:02 -0800"

aValues{2}{1} may equal "Jack@4d.com"

aValues{3}{1} may equal "Call your wife"

Errors are handled the following manner:

1) Only communication-related error codes will be returned. If the command cannot complete its task because of an error (network, syntax, server, etc.) then the appropriate error code will be returned.

2) If a message within the specified range of messages does not exist or gets an error:

No array element is created for that message.

No Error code will be returned.

3) The inability to locate any or all of the specified headers within a message does not constitute an error:

An array element for the message will be created.

The msgNumArray and msgIDArray array elements will contain the appropriate values.

For each header which does not exist in the message, a null string will be returned into that array element.

No Error code will be returned.

See Also

IMAP_MsgLstInfo.


4D - Documentation   Français   English   German   Japanese   4D Internet Commands, Theme List   4D Internet Commands, Alphabetical List   Back   Previous   Next