IGmailClientAsync.DeleteMessageAsync

DeleteMessageAsync(string, CancellationToken)

Asynchronously deletes a message by its ID, moving it to trash by default.

public Task DeleteMessageAsync(string id, CancellationToken cancellationToken = default)
ParameterTypeDescription
idStringThe message ID.
cancellationTokenCancellationTokenA cancellation token.

Return Value

A task representing the asynchronous operation.

See Also


DeleteMessageAsync(string, bool, CancellationToken)

Asynchronously deletes a message by its ID, with an option to move to trash.

public Task DeleteMessageAsync(string id, bool moveToTrash, 
    CancellationToken cancellationToken = default)
ParameterTypeDescription
idStringThe message ID.
moveToTrashBooleanWhether to move the message to trash.
cancellationTokenCancellationTokenA cancellation token.

Return Value

A task representing the asynchronous operation.

See Also