MailBoxLoad

sql

FUNCTION MailBoxLoad(IN mailbox HANDLE, IN flag INT) RETURNS INT;

Parameters

mailbox handle of the mailbox
flag load extent

Since version

6.0f

Description

This function reads the list of letters from the mailbox (specified in the profile) and stores it in the database. Information about letters are being stored in special tables _INBOXMSGS and _INBOXFILES in the _SysExt system application.

The amount of data that can be retrieved differs according to the used mail system. If you're not sure which system will be used by your application, assume the POP3 protocol (the most brief).

The load extent may be modified using the flag parameter. This parameter value may be the sum of the following values:

  0 Only the letter list will be stored in the database
MBL_BODY 1 The texts of the letters (including the headers) will be stored in the database (columns Body and Header)
MBL_FILES 2 The information about attachments will be stored in the database (column FileCnt and columns in the _INBOXFILES table)
MBL_HDRONLY 4 Only the headers will be stored in the database (column Header)
MBL_MSGONLY 8 Only the letter text will be stored in the database (column Body)

The MBL_BODY value cannot be used with the MBL_HDRONLY and MBL_MSGONLY values. The MBL_HDRONLY value is no working for MAPI. The FileCnt column is filled with data already after the letter list is downloaded for Mail602 (MBL_FILES is not necessary).

Retrieving the letter text or the list of attachments may sometimes (according to the used mail type) require downloading the whole letter from the Internet or some remote mailing service, which may significantly extend the operation. If you don't retrieve the letter texts directly with this function, you may do it later for individual letters with the MailBoxGetMsg or MailBoxGetMsgEx function. Information about attachments may also be retrieved later for individual letter using the MailBoxGetFilInfo function. The MailBoxSaveFileAs function stores the attachment to a disk. The MailBoxSaveFileDBr client function stores the attachment in a table (or the MailBoxSaveFileDBs function in SQL).

Function value

This function returns 0 if successful, the error number otherwise.

Example

Receiving example

See