Stores the specified mail messages on the IMAP server.

Namespace: S22.Imap
Assembly: S22.Imap (in S22.Imap.dll) Version: 3.6.0.0 (3.6.0.0)

Syntax

C#
public IEnumerable<uint> StoreMessages(
	IEnumerable<MailMessage> messages,
	bool seen = false,
	string mailbox = null
)

Parameters

messages
Type: System.Collections.Generic..::..IEnumerable<(Of <(<'MailMessage>)>)>
An enumerable collection of mail messages to store on the server.
seen (Optional)
Type: System..::..Boolean
Set this to true to set the \Seen flag for each message on the server.
mailbox (Optional)
Type: System..::..String
The mailbox the messages will be stored in. If this parameter is omitted, the value of the DefaultMailbox property is used to determine the mailbox to store the messages in.

Return Value

An enumerable collection of unique identifiers (UID) representing the stored messages on the server.

Implements

IImapClient..::..StoreMessages(IEnumerable<(Of <<'(MailMessage>)>>), Boolean, String)

Remarks

A unique identifier (UID) is a 32-bit value assigned to each message which uniquely identifies the message within the respective mailbox. No two messages in a mailbox share the same UID.

Exceptions

ExceptionCondition
System..::..ArgumentNullExceptionThe messages parameter is null.
S22.Imap..::..BadServerResponseExceptionThe mail messages could not be stored. The message property of the exception contains the error message returned by the server.
System..::..ObjectDisposedExceptionThe ImapClient object has been disposed.
System.IO..::..IOExceptionThere was a failure writing to or reading from the network.
S22.Imap..::..NotAuthenticatedExceptionThe method was called in non-authenticated state, i.e. before logging in.

See Also