Table of Contents

Method Create

Namespace
MailFathom.Application.Emails.Mailboxes
Assembly
MailFathom.Application.dll

Create(MailboxScope, string?, string?, string?, DateTimeOffset?, DateTimeOffset?, bool?, bool?)

Validates and normalizes the structured filters a request asked for.

public static MailboxEmailSelection Create(MailboxScope scope, string? senderAddress, string? recipientAddress, string? subjectFragment, DateTimeOffset? receivedOnOrAfter, DateTimeOffset? receivedBefore, bool? isRemotelySeen, bool? hasAttachments)

Parameters

scope MailboxScope

The accounts and folders to restrict to.

senderAddress string

The address the sender must carry, in any case, or null for any sender.

recipientAddress string

The address a To or Cc recipient must carry, or null for any recipient.

subjectFragment string

The fragment the subject must contain, or null for any subject.

receivedOnOrAfter DateTimeOffset?

The inclusive start of the received range, or null for no start.

receivedBefore DateTimeOffset?

The exclusive end of the received range, or null for no end.

isRemotelySeen bool?

The remote \Seen state to require, or null for either.

hasAttachments bool?

Whether attachments are required, or null for either.

Returns

MailboxEmailSelection

The validated selection.

Exceptions

ArgumentNullException

Thrown when scope is null.

MailboxQueryFilterInvalidException

Thrown when an address is unusable or over-long, the subject fragment is too long, or the received range can select nothing.