MboxMessage Class

A message of an mbox file, with the From line that starts it.

public sealed class MboxMessage

Properties

NameDescription
ContentGets the bytes of the message, unescaped, without the From line.
DateGets the date of the From line, when it has one in the format of asctime (Mon Jan 5 09:00:00 2026), in UTC.
FromLineGets the From line that starts the message, without its line break.
MessageGets the message, read when it is first accessed.
OffsetGets the position of the From line in the file.
SenderGets the address of the envelope sender, the first word of the From line.

Gets the bytes of the message, unescaped, without the From line.

public ReadOnlyMemory<byte> Content { get; }

Property value

ReadOnlyMemory<byte>

Gets the date of the From line, when it has one in the format of asctime (Mon Jan 5 09:00:00 2026), in UTC.

public DateTimeOffset? Date { get; }

Property value

DateTimeOffset?

Gets the From line that starts the message, without its line break.

public string FromLine { get; }

Property value

string

Gets the message, read when it is first accessed.

public MimeMessage Message { get; }

Property value

MimeMessage

Exceptions

EmailResourceLimitException
The message exceeds a limit of MboxReadOptions.MessageOptions.

Gets the position of the From line in the file.

public long Offset { get; }

Property value

long

Gets the address of the envelope sender, the first word of the From line.

public string? Sender { get; }

Property value

string?

Methods

NameDescription
ToString()Returns the From line.

ToString()

MboxMessage.cs

Returns the From line.

public override string ToString()

Returns

string The From line.