InternetMail.DeleteMessages
Syntax:
Parameters:
<DataArray> (required)
Array, containing message headers or server identifiers of messages to delete from the server.
When operating using the IMAP protocol it is allowed to pass an array of sequence number of messages (integers) in the current mail box (CurrentMailbox).
Description:
Using IMAP marks all the messages which are specified with one of the following ways as deleted from the server:
- InternetMailMessage objects,
- identifiers in an array which is accepted as a parameter,
- ordinal numbers of the messages in the current mail box which is specified in the CurrentMailbox property.
Availability:
Example:
Profile = New InternetMailProfile; FillIn(Profile); Mail = New InternetMail; Mail.Logon(Profile); Array = Mail.Get(False); ArrMess = New Array; ArrUID = New Array; For Num = 0 To Array.Count() - 1 Do If Int(Num / 2) = Num / 2 Then ArrMess.Add(Array[Num]); Else ArrUID.Add(Array[Num].UID[0]); EndIf; EndDo; Mail.DeleteMessages(ArrMess); Mail.DeleteMessages(ArrUID); Mail.Logoff(); |