C# Class MailKit.MailSpool

An abstract mail spool implementation.
An abstract mail spool implementation.
Inheritance: MailService, IMailSpool
Datei anzeigen Open project: jstedfast/MailKit

Public Methods

Method Description
DeleteAllMessages ( CancellationToken cancellationToken = default(CancellationToken) ) : void

Mark all messages for deletion.

Messages marked for deletion are not actually deleted until the session is cleanly disconnected (see IMailService.Disconnect(bool, CancellationToken)).

DeleteAllMessagesAsync ( CancellationToken cancellationToken = default(CancellationToken) ) : Task

Asynchronously mark all messages for deletion.

Messages marked for deletion are not actually deleted until the session is cleanly disconnected (see IMailService.Disconnect(bool, CancellationToken)).

DeleteMessage ( int index, CancellationToken cancellationToken = default(CancellationToken) ) : void

Mark the specified message for deletion.

Messages marked for deletion are not actually deleted until the session is cleanly disconnected (see MailService.Disconnect(bool, CancellationToken)).

DeleteMessageAsync ( int index, CancellationToken cancellationToken = default(CancellationToken) ) : Task

Asynchronously mark the specified message for deletion.

Messages marked for deletion are not actually deleted until the session is cleanly disconnected (see MailService.Disconnect(bool, CancellationToken)).

DeleteMessages ( IList indexes, CancellationToken cancellationToken = default(CancellationToken) ) : void

Mark the specified messages for deletion.

Messages marked for deletion are not actually deleted until the session is cleanly disconnected (see MailService.Disconnect(bool, CancellationToken)).

DeleteMessages ( int startIndex, int count, CancellationToken cancellationToken = default(CancellationToken) ) : void

Mark the specified range of messages for deletion.

Messages marked for deletion are not actually deleted until the session is cleanly disconnected (see MailService.Disconnect(bool, CancellationToken)).

DeleteMessagesAsync ( IList indexes, CancellationToken cancellationToken = default(CancellationToken) ) : Task

Asynchronously mark the specified messages for deletion.

Messages marked for deletion are not actually deleted until the session is cleanly disconnected (see MailService.Disconnect(bool, CancellationToken)).

DeleteMessagesAsync ( int startIndex, int count, CancellationToken cancellationToken = default(CancellationToken) ) : Task

Asynchronously mark the specified range of messages for deletion.

Messages marked for deletion are not actually deleted until the session is cleanly disconnected (see MailService.Disconnect(bool, CancellationToken)).

GetEnumerator ( ) : IEnumerator

Gets an enumerator for the messages in the folder.

Gets an enumerator for the messages in the folder.

GetMessage ( int index, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : MimeMessage

Get the message at the specified index.

Gets the message at the specified index.

GetMessageAsync ( int index, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : Task

Asynchronously get the message at the specified index.

Asynchronously gets the message at the specified index.

GetMessageHeaders ( int index, CancellationToken cancellationToken = default(CancellationToken) ) : HeaderList

Get the headers for the specified message.

Gets the headers for the specified message.

GetMessageHeaders ( IList indexes, CancellationToken cancellationToken = default(CancellationToken) ) : IList

Get the headers for the specified messages.

Gets the headers for the specified messages.

GetMessageHeaders ( int startIndex, int count, CancellationToken cancellationToken = default(CancellationToken) ) : IList

Get the headers of the messages within the specified range.

Gets the headers of the messages within the specified range.

GetMessageHeadersAsync ( int index, CancellationToken cancellationToken = default(CancellationToken) ) : Task

Asynchronously get the headers for the specified message.

Asynchronously gets the headers for the specified message.

GetMessageHeadersAsync ( IList indexes, CancellationToken cancellationToken = default(CancellationToken) ) : Task>

Asynchronously get the headers for the specified messages.

Asynchronously gets the headers for the specified messages.

GetMessageHeadersAsync ( int startIndex, int count, CancellationToken cancellationToken = default(CancellationToken) ) : Task>

Get the headers of the messages within the specified range.

Gets the headers of the messages within the specified range.

GetMessageSize ( int index, CancellationToken cancellationToken = default(CancellationToken) ) : int

Get the size of the specified message, in bytes.

Gets the size of the specified message, in bytes.

GetMessageSizeAsync ( int index, CancellationToken cancellationToken = default(CancellationToken) ) : Task

Asynchronously get the size of the specified message, in bytes.

Asynchronously gets the size of the specified message, in bytes.

GetMessageSizes ( CancellationToken cancellationToken = default(CancellationToken) ) : IList

Get the sizes for all available messages, in bytes.

Gets the sizes for all available messages, in bytes.

GetMessageSizesAsync ( CancellationToken cancellationToken = default(CancellationToken) ) : Task>

Asynchronously get the sizes for all available messages, in bytes.

Asynchronously gets the sizes for all available messages, in bytes.

GetMessageUid ( int index, CancellationToken cancellationToken = default(CancellationToken) ) : string

Get the UID of the message at the specified index.

Not all servers support UIDs, so you should first check the SupportsUids property.

GetMessageUidAsync ( int index, CancellationToken cancellationToken = default(CancellationToken) ) : Task

Asynchronously get the UID of the message at the specified index.

Not all servers support UIDs, so you should first check the SupportsUids property.

GetMessageUids ( CancellationToken cancellationToken = default(CancellationToken) ) : IList

Get the full list of available message UIDs.

Not all servers support UIDs, so you should first check the SupportsUids property.

GetMessageUidsAsync ( CancellationToken cancellationToken = default(CancellationToken) ) : Task>

Get the full list of available message UIDs.

Not all servers support UIDs, so you should first check the SupportsUids property.

GetMessages ( IList indexes, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : IList

Get the messages at the specified indexes.

Get the messages at the specified indexes.

GetMessages ( int startIndex, int count, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : IList

Get the messages within the specified range.

Gets the messages within the specified range.

GetMessagesAsync ( IList indexes, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : Task>

Asynchronously get the messages at the specified indexes.

Asynchronously get the messages at the specified indexes.

GetMessagesAsync ( int startIndex, int count, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : Task>

Asynchronously get the messages within the specified range.

Asynchronously gets the messages within the specified range.

GetStream ( int index, bool headersOnly = false, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : System.Stream

Get the message or header stream at the specified index.

Gets the message or header stream at the specified index.

GetStreamAsync ( int index, bool headersOnly = false, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : Task

Asynchronously get the message or header stream at the specified index.

Asynchronously gets the message or header stream at the specified index.

GetStreams ( IList indexes, bool headersOnly = false, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : IList

Get the message or header streams at the specified indexes.

Get the message or header streams at the specified indexes.

If the mail server supports pipelining, this method will likely be more efficient than using GetStream(int,bool,CancellationToken,ITransferProgress) for each message because it will batch the commands to reduce latency.

GetStreams ( int startIndex, int count, bool headersOnly = false, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : IList

Get the message or header streams within the specified range.

Gets the message or header streams within the specified range.

If the mail server supports pipelining, this method will likely be more efficient than using GetStream(int,bool,CancellationToken,ITransferProgress) for each message because it will batch the commands to reduce latency.

GetStreamsAsync ( IList indexes, bool headersOnly = false, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : Task>

Asynchronously get the message or header streams at the specified indexes.

Asynchronously get the message or header streams at the specified indexes.

GetStreamsAsync ( int startIndex, int count, bool headersOnly = false, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : Task>

Asynchronously get the message or header streams within the specified range.

Asynchronously gets the message or header streams within the specified range.

Reset ( CancellationToken cancellationToken = default(CancellationToken) ) : void

Reset the state of all messages marked for deletion.

Messages marked for deletion are not actually deleted until the session is cleanly disconnected (see IMailService.Disconnect(bool, CancellationToken)).

ResetAsync ( CancellationToken cancellationToken = default(CancellationToken) ) : Task

Asynchronously reset the state of all messages marked for deletion.

Messages marked for deletion are not actually deleted until the session is cleanly disconnected (see IMailService.Disconnect(bool, CancellationToken)).

Protected Methods

Method Description
MailSpool ( IProtocolLogger protocolLogger ) : System

Initializes a new instance of the MailKit.MailSpool class.

Initializes a new instance of the MailKit.MailSpool class.

Private Methods

Method Description
DeleteMessage ( string uid, CancellationToken cancellationToken = default(CancellationToken) ) : void
DeleteMessageAsync ( string uid, CancellationToken cancellationToken = default(CancellationToken) ) : Task
DeleteMessages ( IList uids, CancellationToken cancellationToken = default(CancellationToken) ) : void
DeleteMessagesAsync ( IList uids, CancellationToken cancellationToken = default(CancellationToken) ) : Task
GetMessage ( string uid, CancellationToken cancellationToken = default(CancellationToken) ) : MimeMessage
GetMessageAsync ( string uid, CancellationToken cancellationToken = default(CancellationToken) ) : Task
GetMessageCount ( CancellationToken cancellationToken = default(CancellationToken) ) : int
GetMessageCountAsync ( CancellationToken cancellationToken = default(CancellationToken) ) : Task
GetMessageHeaders ( string uid, CancellationToken cancellationToken = default(CancellationToken) ) : HeaderList
GetMessageHeaders ( IList uids, CancellationToken cancellationToken = default(CancellationToken) ) : IList
GetMessageHeadersAsync ( string uid, CancellationToken cancellationToken = default(CancellationToken) ) : Task
GetMessageHeadersAsync ( IList uids, CancellationToken cancellationToken = default(CancellationToken) ) : Task>
GetMessageSize ( string uid, CancellationToken cancellationToken = default(CancellationToken) ) : int
GetMessageSizeAsync ( string uid, CancellationToken cancellationToken = default(CancellationToken) ) : Task
GetMessages ( IList uids, CancellationToken cancellationToken = default(CancellationToken) ) : IList
GetMessagesAsync ( IList uids, CancellationToken cancellationToken = default(CancellationToken) ) : Task>
IEnumerable ( ) : IEnumerator

Gets an enumerator for the messages in the folder.

Gets an enumerator for the messages in the folder.

Method Details

DeleteAllMessages() public abstract method

Mark all messages for deletion.
Messages marked for deletion are not actually deleted until the session is cleanly disconnected (see IMailService.Disconnect(bool, CancellationToken)).
/// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The command failed. /// /// A protocol error occurred. ///
public abstract DeleteAllMessages ( CancellationToken cancellationToken = default(CancellationToken) ) : void
cancellationToken System.Threading.CancellationToken The cancellation token.
return void

DeleteAllMessagesAsync() public method

Asynchronously mark all messages for deletion.
Messages marked for deletion are not actually deleted until the session is cleanly disconnected (see IMailService.Disconnect(bool, CancellationToken)).
/// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The command failed. /// /// A protocol error occurred. ///
public DeleteAllMessagesAsync ( CancellationToken cancellationToken = default(CancellationToken) ) : Task
cancellationToken System.Threading.CancellationToken The cancellation token.
return Task

DeleteMessage() public abstract method

Mark the specified message for deletion.
Messages marked for deletion are not actually deleted until the session is cleanly disconnected (see MailService.Disconnect(bool, CancellationToken)).
/// is not a valid message index. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The command failed. /// /// A protocol error occurred. ///
public abstract DeleteMessage ( int index, CancellationToken cancellationToken = default(CancellationToken) ) : void
index int The index of the message.
cancellationToken System.Threading.CancellationToken The cancellation token.
return void

DeleteMessageAsync() public method

Asynchronously mark the specified message for deletion.
Messages marked for deletion are not actually deleted until the session is cleanly disconnected (see MailService.Disconnect(bool, CancellationToken)).
/// is not a valid message index. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The command failed. /// /// A protocol error occurred. ///
public DeleteMessageAsync ( int index, CancellationToken cancellationToken = default(CancellationToken) ) : Task
index int The index of the message.
cancellationToken System.Threading.CancellationToken The cancellation token.
return Task

DeleteMessages() public abstract method

Mark the specified messages for deletion.
Messages marked for deletion are not actually deleted until the session is cleanly disconnected (see MailService.Disconnect(bool, CancellationToken)).
/// is null. /// /// One or more of the are invalid. /// -or- /// No indexes were specified. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The command failed. /// /// A protocol error occurred. ///
public abstract DeleteMessages ( IList indexes, CancellationToken cancellationToken = default(CancellationToken) ) : void
indexes IList The indexes of the messages.
cancellationToken System.Threading.CancellationToken The cancellation token.
return void

DeleteMessages() public abstract method

Mark the specified range of messages for deletion.
Messages marked for deletion are not actually deleted until the session is cleanly disconnected (see MailService.Disconnect(bool, CancellationToken)).
/// and do not specify /// a valid range of messages. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The command failed. /// /// A protocol error occurred. ///
public abstract DeleteMessages ( int startIndex, int count, CancellationToken cancellationToken = default(CancellationToken) ) : void
startIndex int The index of the first message to mark for deletion.
count int The number of messages to mark for deletion.
cancellationToken System.Threading.CancellationToken The cancellation token.
return void

DeleteMessagesAsync() public method

Asynchronously mark the specified messages for deletion.
Messages marked for deletion are not actually deleted until the session is cleanly disconnected (see MailService.Disconnect(bool, CancellationToken)).
/// is null. /// /// One or more of the are invalid. /// -or- /// No indexes were specified. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The command failed. /// /// A protocol error occurred. ///
public DeleteMessagesAsync ( IList indexes, CancellationToken cancellationToken = default(CancellationToken) ) : Task
indexes IList The indexes of the messages.
cancellationToken System.Threading.CancellationToken The cancellation token.
return Task

DeleteMessagesAsync() public method

Asynchronously mark the specified range of messages for deletion.
Messages marked for deletion are not actually deleted until the session is cleanly disconnected (see MailService.Disconnect(bool, CancellationToken)).
/// and do not specify /// a valid range of messages. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The command failed. /// /// A protocol error occurred. ///
public DeleteMessagesAsync ( int startIndex, int count, CancellationToken cancellationToken = default(CancellationToken) ) : Task
startIndex int The index of the first message to mark for deletion.
count int The number of messages to mark for deletion.
cancellationToken System.Threading.CancellationToken The cancellation token.
return Task

GetEnumerator() public abstract method

Gets an enumerator for the messages in the folder.
Gets an enumerator for the messages in the folder.
/// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// A POP3 command failed. /// /// A protocol error occurred. ///
public abstract GetEnumerator ( ) : IEnumerator
return IEnumerator

GetMessage() public abstract method

Get the message at the specified index.
Gets the message at the specified index.
/// is not a valid message index. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The command failed. /// /// A protocol error occurred. ///
public abstract GetMessage ( int index, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : MimeMessage
index int The index of the message.
cancellationToken System.Threading.CancellationToken The cancellation token.
progress ITransferProgress The progress reporting mechanism.
return MimeKit.MimeMessage

GetMessageAsync() public method

Asynchronously get the message at the specified index.
Asynchronously gets the message at the specified index.
/// is not a valid message index. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The command failed. /// /// A protocol error occurred. ///
public GetMessageAsync ( int index, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : Task
index int The index of the message.
cancellationToken System.Threading.CancellationToken The cancellation token.
progress ITransferProgress The progress reporting mechanism.
return Task

GetMessageHeaders() public abstract method

Get the headers for the specified message.
Gets the headers for the specified message.
/// is not a valid message index. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The command failed. /// /// A protocol error occurred. ///
public abstract GetMessageHeaders ( int index, CancellationToken cancellationToken = default(CancellationToken) ) : HeaderList
index int The index of the message.
cancellationToken System.Threading.CancellationToken The cancellation token.
return HeaderList

GetMessageHeaders() public abstract method

Get the headers for the specified messages.
Gets the headers for the specified messages.
/// is null. /// /// One or more of the are invalid. /// -or- /// No indexes were specified. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The command failed. /// /// A protocol error occurred. ///
public abstract GetMessageHeaders ( IList indexes, CancellationToken cancellationToken = default(CancellationToken) ) : IList
indexes IList The indexes of the messages.
cancellationToken System.Threading.CancellationToken The cancellation token.
return IList

GetMessageHeaders() public abstract method

Get the headers of the messages within the specified range.
Gets the headers of the messages within the specified range.
/// and do not specify /// a valid range of messages. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The command failed. /// /// A protocol error occurred. ///
public abstract GetMessageHeaders ( int startIndex, int count, CancellationToken cancellationToken = default(CancellationToken) ) : IList
startIndex int The index of the first message to get.
count int The number of messages to get.
cancellationToken System.Threading.CancellationToken The cancellation token.
return IList

GetMessageHeadersAsync() public method

Asynchronously get the headers for the specified message.
Asynchronously gets the headers for the specified message.
/// is not a valid message index. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The command failed. /// /// A protocol error occurred. ///
public GetMessageHeadersAsync ( int index, CancellationToken cancellationToken = default(CancellationToken) ) : Task
index int The index of the message.
cancellationToken System.Threading.CancellationToken The cancellation token.
return Task

GetMessageHeadersAsync() public method

Asynchronously get the headers for the specified messages.
Asynchronously gets the headers for the specified messages.
/// is null. /// /// One or more of the are invalid. /// -or- /// No indexes were specified. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The command failed. /// /// A protocol error occurred. ///
public GetMessageHeadersAsync ( IList indexes, CancellationToken cancellationToken = default(CancellationToken) ) : Task>
indexes IList The indexes of the messages.
cancellationToken System.Threading.CancellationToken The cancellation token.
return Task>

GetMessageHeadersAsync() public method

Get the headers of the messages within the specified range.
Gets the headers of the messages within the specified range.
/// and do not specify /// a valid range of messages. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The command failed. /// /// A protocol error occurred. ///
public GetMessageHeadersAsync ( int startIndex, int count, CancellationToken cancellationToken = default(CancellationToken) ) : Task>
startIndex int The index of the first message to get.
count int The number of messages to get.
cancellationToken System.Threading.CancellationToken The cancellation token.
return Task>

GetMessageSize() public abstract method

Get the size of the specified message, in bytes.
Gets the size of the specified message, in bytes.
/// is not a valid message index. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The command failed. /// /// A protocol error occurred. ///
public abstract GetMessageSize ( int index, CancellationToken cancellationToken = default(CancellationToken) ) : int
index int The index of the message.
cancellationToken System.Threading.CancellationToken The cancellation token.
return int

GetMessageSizeAsync() public method

Asynchronously get the size of the specified message, in bytes.
Asynchronously gets the size of the specified message, in bytes.
/// is not a valid message index. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The command failed. /// /// A protocol error occurred. ///
public GetMessageSizeAsync ( int index, CancellationToken cancellationToken = default(CancellationToken) ) : Task
index int The index of the message.
cancellationToken System.Threading.CancellationToken The cancellation token.
return Task

GetMessageSizes() public abstract method

Get the sizes for all available messages, in bytes.
Gets the sizes for all available messages, in bytes.
/// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The command failed. /// /// A protocol error occurred. ///
public abstract GetMessageSizes ( CancellationToken cancellationToken = default(CancellationToken) ) : IList
cancellationToken System.Threading.CancellationToken The cancellation token.
return IList

GetMessageSizesAsync() public method

Asynchronously get the sizes for all available messages, in bytes.
Asynchronously gets the sizes for all available messages, in bytes.
/// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The command failed. /// /// A protocol error occurred. ///
public GetMessageSizesAsync ( CancellationToken cancellationToken = default(CancellationToken) ) : Task>
cancellationToken System.Threading.CancellationToken The cancellation token.
return Task>

GetMessageUid() public abstract method

Get the UID of the message at the specified index.
Not all servers support UIDs, so you should first check the SupportsUids property.
/// is not a valid message index. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The mail spool does not support UIDs. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The command failed. /// /// A protocol error occurred. ///
public abstract GetMessageUid ( int index, CancellationToken cancellationToken = default(CancellationToken) ) : string
index int The message index.
cancellationToken System.Threading.CancellationToken The cancellation token.
return string

GetMessageUidAsync() public method

Asynchronously get the UID of the message at the specified index.
Not all servers support UIDs, so you should first check the SupportsUids property.
/// is not a valid message index. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The mail spool does not support UIDs. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The command failed. /// /// A protocol error occurred. ///
public GetMessageUidAsync ( int index, CancellationToken cancellationToken = default(CancellationToken) ) : Task
index int The message index.
cancellationToken System.Threading.CancellationToken The cancellation token.
return Task

GetMessageUids() public abstract method

Get the full list of available message UIDs.
Not all servers support UIDs, so you should first check the SupportsUids property.
/// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The mail spool does not support UIDs. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The command failed. /// /// A protocol error occurred. ///
public abstract GetMessageUids ( CancellationToken cancellationToken = default(CancellationToken) ) : IList
cancellationToken System.Threading.CancellationToken The cancellation token.
return IList

GetMessageUidsAsync() public method

Get the full list of available message UIDs.
Not all servers support UIDs, so you should first check the SupportsUids property.
/// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The mail spool does not support UIDs. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The command failed. /// /// A protocol error occurred. ///
public GetMessageUidsAsync ( CancellationToken cancellationToken = default(CancellationToken) ) : Task>
cancellationToken System.Threading.CancellationToken The cancellation token.
return Task>

GetMessages() public abstract method

Get the messages at the specified indexes.
Get the messages at the specified indexes.
/// is null. /// /// One or more of the are invalid. /// -or- /// No indexes were specified. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The command failed. /// /// A protocol error occurred. ///
public abstract GetMessages ( IList indexes, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : IList
indexes IList The indexes of the messages.
cancellationToken System.Threading.CancellationToken The cancellation token.
progress ITransferProgress The progress reporting mechanism.
return IList

GetMessages() public abstract method

Get the messages within the specified range.
Gets the messages within the specified range.
/// and do not specify /// a valid range of messages. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The command failed. /// /// A protocol error occurred. ///
public abstract GetMessages ( int startIndex, int count, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : IList
startIndex int The index of the first message to get.
count int The number of messages to get.
cancellationToken System.Threading.CancellationToken The cancellation token.
progress ITransferProgress The progress reporting mechanism.
return IList

GetMessagesAsync() public method

Asynchronously get the messages at the specified indexes.
Asynchronously get the messages at the specified indexes.
/// is null. /// /// One or more of the are invalid. /// -or- /// No indexes were specified. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The command failed. /// /// A protocol error occurred. ///
public GetMessagesAsync ( IList indexes, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : Task>
indexes IList The indexes of the messages.
cancellationToken System.Threading.CancellationToken The cancellation token.
progress ITransferProgress The progress reporting mechanism.
return Task>

GetMessagesAsync() public method

Asynchronously get the messages within the specified range.
Asynchronously gets the messages within the specified range.
/// and do not specify /// a valid range of messages. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The command failed. /// /// A protocol error occurred. ///
public GetMessagesAsync ( int startIndex, int count, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : Task>
startIndex int The index of the first message to get.
count int The number of messages to get.
cancellationToken System.Threading.CancellationToken The cancellation token.
progress ITransferProgress The progress reporting mechanism.
return Task>

GetStream() public abstract method

Get the message or header stream at the specified index.
Gets the message or header stream at the specified index.
/// is not a valid message index. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The command failed. /// /// A protocol error occurred. ///
public abstract GetStream ( int index, bool headersOnly = false, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : System.Stream
index int The index of the message.
headersOnly bool true if only the headers should be retrieved; otherwise, false.
cancellationToken System.Threading.CancellationToken The cancellation token.
progress ITransferProgress The progress reporting mechanism.
return System.Stream

GetStreamAsync() public method

Asynchronously get the message or header stream at the specified index.
Asynchronously gets the message or header stream at the specified index.
/// is not a valid message index. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The command failed. /// /// A protocol error occurred. ///
public GetStreamAsync ( int index, bool headersOnly = false, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : Task
index int The index of the message.
headersOnly bool true if only the headers should be retrieved; otherwise, false.
cancellationToken System.Threading.CancellationToken The cancellation token.
progress ITransferProgress The progress reporting mechanism.
return Task

GetStreams() public abstract method

Get the message or header streams at the specified indexes.

Get the message or header streams at the specified indexes.

If the mail server supports pipelining, this method will likely be more efficient than using GetStream(int,bool,CancellationToken,ITransferProgress) for each message because it will batch the commands to reduce latency.

/// is null. /// /// One or more of the are invalid. /// -or- /// No indexes were specified. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The command failed. /// /// A protocol error occurred. ///
public abstract GetStreams ( IList indexes, bool headersOnly = false, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : IList
indexes IList The indexes of the messages.
headersOnly bool true if only the headers should be retrieved; otherwise, false.
cancellationToken System.Threading.CancellationToken The cancellation token.
progress ITransferProgress The progress reporting mechanism.
return IList

GetStreams() public abstract method

Get the message or header streams within the specified range.

Gets the message or header streams within the specified range.

If the mail server supports pipelining, this method will likely be more efficient than using GetStream(int,bool,CancellationToken,ITransferProgress) for each message because it will batch the commands to reduce latency.

/// and do not specify /// a valid range of messages. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The command failed. /// /// A protocol error occurred. ///
public abstract GetStreams ( int startIndex, int count, bool headersOnly = false, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : IList
startIndex int The index of the first stream to get.
count int The number of streams to get.
headersOnly bool true if only the headers should be retrieved; otherwise, false.
cancellationToken System.Threading.CancellationToken The cancellation token.
progress ITransferProgress The progress reporting mechanism.
return IList

GetStreamsAsync() public method

Asynchronously get the message or header streams at the specified indexes.
Asynchronously get the message or header streams at the specified indexes.
/// is null. /// /// One or more of the are invalid. /// -or- /// No indexes were specified. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The command failed. /// /// A protocol error occurred. ///
public GetStreamsAsync ( IList indexes, bool headersOnly = false, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : Task>
indexes IList The indexes of the messages.
headersOnly bool true if only the headers should be retrieved; otherwise, false.
cancellationToken System.Threading.CancellationToken The cancellation token.
progress ITransferProgress The progress reporting mechanism.
return Task>

GetStreamsAsync() public method

Asynchronously get the message or header streams within the specified range.
Asynchronously gets the message or header streams within the specified range.
/// and do not specify /// a valid range of messages. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The command failed. /// /// A protocol error occurred. ///
public GetStreamsAsync ( int startIndex, int count, bool headersOnly = false, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : Task>
startIndex int The index of the first stream to get.
count int The number of streams to get.
headersOnly bool true if only the headers should be retrieved; otherwise, false.
cancellationToken System.Threading.CancellationToken The cancellation token.
progress ITransferProgress The progress reporting mechanism.
return Task>

MailSpool() protected method

Initializes a new instance of the MailKit.MailSpool class.
Initializes a new instance of the MailKit.MailSpool class.
/// is null. ///
protected MailSpool ( IProtocolLogger protocolLogger ) : System
protocolLogger IProtocolLogger The protocol logger.
return System

Reset() public abstract method

Reset the state of all messages marked for deletion.
Messages marked for deletion are not actually deleted until the session is cleanly disconnected (see IMailService.Disconnect(bool, CancellationToken)).
/// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The command failed. /// /// A protocol error occurred. ///
public abstract Reset ( CancellationToken cancellationToken = default(CancellationToken) ) : void
cancellationToken System.Threading.CancellationToken The cancellation token.
return void

ResetAsync() public method

Asynchronously reset the state of all messages marked for deletion.
Messages marked for deletion are not actually deleted until the session is cleanly disconnected (see IMailService.Disconnect(bool, CancellationToken)).
/// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The command failed. /// /// A protocol error occurred. ///
public ResetAsync ( CancellationToken cancellationToken = default(CancellationToken) ) : Task
cancellationToken System.Threading.CancellationToken The cancellation token.
return Task