Table of Contents

Class NamedRecipient

Namespace
MailFathom.Application.Mail.Delivery.Addressing
Assembly
MailFathom.Application.dll

States how an author named one recipient: by an address, or by somebody the contact book holds.

public sealed record NamedRecipient : IEquatable<NamedRecipient>
Inheritance
NamedRecipient
Implements
Inherited Members

Remarks

This is the shape every author writes, and it is deliberately not the shape a message is composed from. An address is what a submission server is offered, so a recipient named as a person becomes one before anything is composed — naming a contact is a convenience of the authoring boundary rather than a second kind of recipient the rest of the send has to understand.

A contact is named either by the identity the book gave it or by the name the owner recorded, and exactly one of the two. The name is the whole name rather than part of one, and it addresses a message only where it belongs to one person: a recipient chosen out of several by a ranking is a message delivered to somebody nobody named.

Everything a caller supplied is untrusted, and the address text is carried unparsed for the same reason AuthoredEmailRecipient carries one: repairing an address before it is composed would mail somebody nobody named.

Properties

Address

Gets the addr-spec the author supplied, or null when they named a contact instead.

Contact

Gets the contact named by identity, or null when the recipient was named another way.

ContactAddress

Gets which of the contact's addresses to use, or null to use the one they prefer.

ContactName

Gets the contact named by the owner's own name for them, or null when the recipient was named another way.

DisplayName

Gets the name to write beside a supplied address, or null to write the address alone.

Role

Gets the header the author wants this person named in.

Methods

AtAddress(OutgoingRecipientRole, string, string?)

Names a recipient by the address the author wrote.

ByContact(OutgoingRecipientRole, ContactId, string?)

Names a recipient by the identity the book gave them.

ByContactName(OutgoingRecipientRole, ContactDisplayName, string?)

Names a recipient by the name the owner recorded for them.