Method TryCreate
- Namespace
- MailFathom.Domain.Emails
- Assembly
- MailFathom.Domain.dll
TryCreate(string?, string?, out EmailAddress)
Builds a participant address from the parts a mail header supplied.
public static bool TryCreate(string? displayName, string? address, out EmailAddress emailAddress)
Parameters
displayNamestringThe display name the header carried, if any.
addressstringThe addr-spec the header carried.
emailAddressEmailAddressThe normalized address, when the addr-spec is usable.
Returns
Remarks
A malformed address is refused rather than repaired, because guessing what an unparseable header meant would put an address nobody wrote into a filter someone later trusts. Refusal costs one participant of one message, which is why extraction skips it instead of failing the message.