Class MboxWriter
Writes MBOX mailbox files (RFC 4155) to a stream. Each message is
preceded by a From line and its body is mboxrd-quoted.
Always emits CRLF line endings. Not thread-safe.
Implements
Inherited Members
Namespace: DRIT.Mail.Rfc.Mbox
Assembly: DRIT.Mail.dll
Syntax
public sealed class MboxWriter : IDisposable
Constructors
View SourceMboxWriter(Stream)
Initializes a new instance of the MboxWriter class.
Declaration
public MboxWriter(Stream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | stream | The stream used to read or write the data. |
MboxWriter(Stream, bool)
Initializes a new instance of the MboxWriter class.
Declaration
public MboxWriter(Stream stream, bool leaveOpen)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | stream | The stream used to read or write the data. |
| bool | leaveOpen | The leave open used by the operation. |
Methods
View SourceDispose()
Processes the dispose data.
Declaration
public void Dispose()
WriteMessage(MimeMessage, MboxFromLine?)
Writes a message. The From line is derived from the message's
From/Sender/Return-Path and Date, or from
fromLine if provided.
Declaration
public void WriteMessage(MimeMessage message, MboxFromLine? fromLine = null)
Parameters
| Type | Name | Description |
|---|---|---|
| MimeMessage | message | The message to write. |
| MboxFromLine | fromLine | The From line to use, or null to derive one from the message. |
WriteMessage(MimeMessage, string)
Writes a message with an explicit envelope sender. The timestamp is taken from the message Date, or UtcNow if absent.
Declaration
public void WriteMessage(MimeMessage message, string envelopeSender)
Parameters
| Type | Name | Description |
|---|---|---|
| MimeMessage | message | The message to write. |
| string | envelopeSender | The envelope sender for the From line. |