Topic Path: Symbol Reference > Classes > TIdIMAP4 Class > TIdIMAP4 Methods > ExpungeMailBox Method
TIdIMAP4.ExpungeMailBox Method

Removes messages marked for deletion in the currently selected mailbox.

function ExpungeMailBox: Boolean;

Boolean - True on success.

ExpungeMailBox is a Boolean function that permanently removes messages marked for deletion in the currently selected mailbox. Messages marked for deletion contain the Deleted flag. 

ExpungeMailBox requires that ConnectionState contain the value csSelected, or an EIdConnectionStateError exception will be raised. 

ExpungeMailBox calls the SendCmd method using the IMAP EXPUNGE command, and on successful completion calls the ParseExpungeResult method for the selected mailbox. Please note that ExpungeMailBox does not affect the current list of messages stored in the MailBox property; the application is responsible for synchronizing the local and remote storage for the mailbox. 

ExpungeMailBox sets the return value to True when the IMAP4 protocol response contains the value IMAP_OK

Use DeleteMsgs, or UIDDeleteMsgs to mark messages for deletion.

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