4D Internet Commands v16

IMAP_GetMessage

Home

 
4D Internet Commands v16
IMAP_GetMessage

IMAP_GetMessage 


 

IMAP_GetMessage ( imap_ID ; msgNum ; offset ; length ; msgPart ; msgText {; updateSeen} ) -> Function result 
Parameter Type   Description
imap_ID  Longint in Reference to an IMAP login
msgNum  Longint in Message number
offset  Longint in Offset of character at which to begin retrieval
length  Longint in How many characters to return
msgPart  Integer in 0 = Entire message, 1 = Only header, 2= Only Body
msgText  Text in Message Text
updateSeen  Integer in 0 = Update \Seen Flag; 1 = Do not update
Function result  Integer in Error code

The IMAP_GetMessage command returns the complete text of the message identified by msgNum within the current mailbox referenced by IMAP_SetCurrentMB. Unless otherwise specified by the IMAP_SetPrefs command, any linefeed characters within the message will be removed.

The IMAP_GetMessage command returns either the entire block of the message, including header information, or with header only or body only, depending on the msgPart parameter.

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

msgNum is a long integer value indicating which message in the mailbox to retrieve. This number represents the position of a message within the current list of messages. You cannot rely on msgNum remaining the same for a specific e-mail item from session to session.

offset is a long integer value indicating the number of characters from the beginning of the specified msgPart to begin reading. In most circumstances a zero should be passed to this parameter.

length is a long integer value representing the number of characters beyond the offset position to retrieve. Since the maximum length of a 4D text variable is limited to 32,000 characters, the length parameter should be set to any number below 32,000. Messages whose msgPart size is greater than 32K must be saved to the disk via the IMAP_Download command.

msgPart indicates the message part to retrieve. Values 0, 1 or 2 can be passed:

  • 0 = Entire message,
  • 1 = Only header,
  • 2 = Only body (means first Text/ plain encountered).

Retrieving entire message or only header retrieves raw text without decoding. On the other hand, when retrieving only body, the text will be decoded and converted automatically if needed (see POP3_Charset for more information concerning decoding and conversion rules).

updateSeen is an integer value that indicates if the flag \Seen has to be added to the message flags whether implicitly or not. This parameter is optional and the default value is used if this parameter is not passed.

  • 0 = Add \Seen Flag (default value);
  • 1= Do not add \Seen Flag;

msgText is a text variable that will receive the retrieved text.



See also 

IMAP_Download
IMAP_Login
IMAP_SetCurrentMB
IMAP_SetPrefs

 
PROPERTIES 

Product: 4D Internet Commands
Theme: IC IMAP Review Mail
Number: 88873

 
HISTORY 

Created: 4D Internet Commands 6.8.1

 
ARTICLE USAGE

4D Internet Commands ( 4D Internet Commands v16)