Method Create
- Namespace
- MailFathom.Application.Emails.Mailboxes
- Assembly
- MailFathom.Application.dll
Create(MailboxScope, string?, string?, string?, DateTimeOffset?, DateTimeOffset?, bool?, bool?, string?, bool?, EmailMarkSelection?)
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? isRemotelyFlagged, string? keyword, bool? hasAttachments, EmailMarkSelection? mark = null)
Parameters
scopeMailboxScopeThe accounts and folders to restrict to.
senderAddressstringThe address the sender must carry, in any case, or null for any sender.
recipientAddressstringThe address a
ToorCcrecipient must carry, or null for any recipient.subjectFragmentstringThe fragment the subject must contain, or null for any subject.
receivedOnOrAfterDateTimeOffset?The inclusive start of the received range, or null for no start.
receivedBeforeDateTimeOffset?The exclusive end of the received range, or null for no end.
isRemotelySeenbool?The remote
\Seenstate to require, or null for either.isRemotelyFlaggedbool?The remote
\Flaggedstate to require, or null for either.keywordstringThe keyword an email must carry, in any case, or null for any.
hasAttachmentsbool?Whether attachments are required, or null for either.
markEmailMarkSelectionThe reading a derivation must have made about the email, or null when no reading is required.
Returns
- MailboxEmailSelection
The validated selection.
Remarks
The reading is optional in the signature because only a screen drawing MailFathom's own marks ever asks for one, and every other read model narrows by none: an omitted argument here says the same thing a null says for each of the filters above it.
Exceptions
- ArgumentNullException
Thrown when
scopeis null.- MailboxQueryFilterInvalidException
Thrown when an address is unusable or over-long, the subject fragment is too long, the keyword is not one this system stores, or the received range can select nothing.