• DR-IT Software
  • Products
  • Documentation
  • Product page
  • Examples
  • API reference
  • Support
Show / Hide Table of Contents

Class HeaderParser

Parses MIME headers from a stream. Handles RFC 5322 §2.2.3 header folding (unfolding) and splits headers into name/value pairs with optional parameters.

Inheritance
object
HeaderParser
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: DRIT.Mail.Rfc.Mime.Parsing
Assembly: DRIT.Mail.dll
Syntax
public static class HeaderParser

Methods

View Source

Parse(LineReader)

Reads all headers from a LineReader positioned at the start of the header section. Stops at the first blank line (the header/body separator). The reader is left positioned just past the blank line.

Declaration
public static MimeHeaderCollection Parse(LineReader reader)
Parameters
Type Name Description
LineReader reader

Specifies the reader value.

Returns
Type Description
MimeHeaderCollection
View Source

ParseHeader(string, string)

Parses a single header line (already unfolded) into a MimeHeader.

Declaration
public static MimeHeader ParseHeader(string name, string rawValue)
Parameters
Type Name Description
string name

Specifies the name value.

string rawValue

The raw value used by the operation.

Returns
Type Description
MimeHeader
View Source

ReadHeaderBlock(Stream)

Reads all header bytes from a stream until the blank line separator. Returns the headers as a single unfolded string block. Used when raw access to the header section is needed.

Declaration
public static string ReadHeaderBlock(Stream stream)
Parameters
Type Name Description
Stream stream

The stream used to read or write the data.

Returns
Type Description
string
  • View Source
Back to top

DR-IT Software documentation

DR-IT Software · Products · Documentation index · Product page · Downloads · Support · Licensing

Generated by DocFX