UndeleteMessage Method  
 

Removes the deletion flag for the specified message.

Syntax

object.UndeleteMessage( MessageNumber )

Parameters

MessageNumber
Number of message to undelete from the server. This value must be greater than zero. The first message in the mailbox is message number one.

Return Value

A value of zero is returned if the method succeeds. Otherwise, a non-zero error code is returned which indicates the cause of the failure.

Remarks

The UndeleteMessage method removes the deletion flag for the specified message in the current mailbox. To determine if a message has been marked for deletion, set the MessageIndex property to the message number and then check the value of the MessageFlags property to determine if the mailFlagDeleted bit flag has been set.

This method can only be used when connected to an IMAP server.

See Also

MessageFlags Property, MessageIndex Property, DeleteMessage Method, SelectMailbox Method