Topic Path: Symbol Reference > Classes > TIdIMAP4 Class > TIdIMAP4 Methods > UIDRetrieveMailBoxSize Method
ContentsIndexHome
PreviousUpNext
TIdIMAP4.UIDRetrieveMailBoxSize Method

Indicates the size of all messages in the currently selected mailbox.

function UIDRetrieveMailBoxSize: Integer;

Integer - Bytes required to store all messages in the mailbox or -1 when an error occurs.

UIDRetrieveMailBoxSize is an Integer function that calculates the size of all messages in the currently selected mailbox. The calculated size for the mailbox includes all message parts (including attachments) currently stored on the remote IMAP4 server. 

UIDRetrieveMailBoxSize requires that ConnectionState contain the value csSelected, or an EIdConnectionStateError exception will be raised. Use SelectMailBox or ExamineMailBox to select the current mailbox for the IMAP4 account prior to calling UIDRetrieveMailBoxSize. 

UIDRetrieveMailBoxSize calls SendCMd using the IMAP4 FETCH command to get the message size for each of the message UIDs in the IMAP4 mailbox, and accumulates the total size as the return value for the method. The return value for UIDRetrieveMailBoxSize is -1 if a protocol response error occurs in the method. 

Use RetreiveMsgSize or UIDRetreiveMsgSize to determine the size of a specific message stored in the currently selected mailbox for the IMAP4 account.

Copyright 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.