Internet Direct (Indy)
Home
PreviousUpNext
TIdIMAP4.ExpungeMailBox Method

Removes messages marked for deletion in the currently selected mailbox.

Pascal
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.

Internet Direct (Indy) version 10.1.5
Copyright © 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Website http://www.indyproject.org.
Post feedback to the Indy Documentation newsgroup.