InternetMail.Get

Syntax:

Get(<ToDeleteMessages>, <ArrayOfMessageHeadersOrIdentifies>, <MarkAsRead>)

Parameters:

<ToDeleteMessages> (optional)

Type: Boolean.
True - delete selected message from the server.
Default value: True.

<ArrayOfMessageHeadersOrIdentifies> (optional)

Type: Array.
Message header array. If the array is empty or has not been transferred the method returns all of the messages from the server.
For the IMAP connection the array can contain sequence numbers of messages in the current mail box (see CurrentMailbox).
Default value: Am empty array.

<MarkAsRead> (optional)

Type: Boolean.
Mark mails on the server as read.
Relevant only for IMAP, and the only allowed value for POP3 protocol is True.
In the compatibility mode Version8_3_5, the default values are:
Default value: True.

Returned value:

Type: Array.
Array of InternetMailMessage type objects.
If the MessageArray parameter contains an empty array or was not specified, then all messages from server are returned in full.

Description:

It is used to get messages from the server.

Availability:

Thin client, server, thick client, external connection, Mobile application (client), Mobile application (server).

Example:

Profile = New InternetMailProfile;
FillInProfile(Profile);

Mail = New InternetMail;
Mail.Logon(Profile);

News = Mail.Get(True);

If 
News.Count() = 0 Then

    Message("There are no messages on the server.");

EndIf
;       

Mail.Logoff();

See also:

InternetMail, method GetHeaders
InternetMail, method GetUIDL
InternetMail, method GetMessageCount
InternetMail, property CurrentMailbox

    

1C:Enterprise Developer's Community