Class AuthoredEmail
- Namespace
- MailFathom.Application.Mail.Delivery.Composition
- Assembly
- MailFathom.Application.dll
States everything an author decides about one message, and nothing this system decides for them.
public sealed record AuthoredEmail : IEquatable<AuthoredEmail>
- Inheritance
-
AuthoredEmail
- Implements
- Inherited Members
Remarks
There is no sender here, and that absence is the contract. The From address, the name written beside
it, the Message-ID, and the Date are the sending account's and this system's; a member for any of them
would be a way to send mail as somebody else, and no validation of such a member is as strong as not having one.
Every protocol boundary that ever authors a message builds this type, so the guarantee holds for all of them at once
rather than being re-argued per adapter.
A plain-text body is required and an HTML one is optional, in that order rather than the reverse. A message whose plain text was derived by stripping tags out of markup reads as damage to every recipient whose client shows it, and producing one is how a system ends up sending text nobody wrote — so the text an author wrote is what is sent, and an author who supplies only markup has not written a message this system will compose.
Everything here is untrusted input, including the fields that look inert. A subject, a display name, and a file name each end up in a header, so each is a place a newline could smuggle a header the author never wrote.
Properties
- Attachments
Gets the files the author attached, which is ordinarily none.
- PlainTextBody
Gets the plain-text body the author wrote, which every composed message carries.
- Recipients
Gets the people the message is addressed to, in the headers the author named them in.
- Subject
Gets the subject line the author wrote.