Constructor AuthoredEmailAttachment
- Namespace
- MailFathom.Application.Mail.Delivery.Composition
- Assembly
- MailFathom.Application.dll
AuthoredEmailAttachment(string, string, ReadOnlyMemory<byte>)
Names one file an author attached, with the octets it is made of.
public AuthoredEmailAttachment(string FileName, string MediaType, ReadOnlyMemory<byte> Content)
Parameters
FileNamestringThe name the recipient sees the file under.
MediaTypestringThe media type the file is declared as, which is recorded rather than sniffed.
ContentReadOnlyMemory<byte>The octets of the file.
Remarks
The media type is the author's statement about their own file. Deriving one from the octets would be this system asserting what somebody else's file is, and deriving one from the extension would be the same guess with less evidence; what a wrong media type costs is a recipient's client opening the file with the wrong application, which is the author's mistake to make and to correct.
The octets are memory rather than a stream because the whole file is measured against the deployment's bounds before any of it is composed, and a message the bounds refuse must never have been read. A future attachment source large enough to matter is a streaming port rather than a wider parameter here.