Method ByContactName
- Namespace
- MailFathom.Application.Mail.Delivery.Addressing
- Assembly
- MailFathom.Application.dll
ByContactName(OutgoingRecipientRole, ContactDisplayName, string?)
Names a recipient by the name the owner recorded for them.
public static NamedRecipient ByContactName(OutgoingRecipientRole role, ContactDisplayName contactName, string? contactAddress = null)
Parameters
roleOutgoingRecipientRoleThe header to name them in.
contactNameContactDisplayNameThe whole name the owner wrote down.
contactAddressstringWhich of their addresses to use, or null for the one they prefer.
Returns
- NamedRecipient
The recipient the author named.
Exceptions
- ArgumentException
Thrown when
contactAddressis supplied blank.- ArgumentOutOfRangeException
Thrown when
roleis not a declared role.