SocketTools .NET Edition

MailMessage.DeleteMessage Method ()

Remove the current message from the current message store.

[Visual Basic]
Overloads Public Function DeleteMessage() As Boolean
[C#]
public bool DeleteMessage();

Return Value

This method returns a boolean value. If the method succeeds, the return value is true. If the method fails, the return value is false. To get extended error information, check the value of the LastError property.

Remarks

The DeleteMessage method marks the current message for deletion from the storage file. When the message store is closed or purged, the message is removed from the file. The value of the StoreIndex property specifies the current message.

Once a message has been marked for deletion, it may no longer be referenced by the application. For example, you cannot access the contents of a message that has been deleted.

The message store must be opened with write access. This method will fail if you attempt to delete a message from a storage file that has been opened for read-only access. If the application needs to delete messages in the message store, it is recommended that the file be opened for exclusive access using the storeLock option when calling the OpenStore method.

See Also

MailMessage Class | SocketTools Namespace | MailMessage.DeleteMessage Overload List