MimeParser Class

A MIME message and entity parser.

Definition

Namespace: MimeKit
Assembly: MimeKit.Core (in MimeKit.Core.dll) Version: 5.0.0
C#
public class MimeParser : IMimeParser
Inheritance
Object    MimeParser
Implements
IMimeParser

Remarks

A MIME parser is used to parse MimeMessage and MimeEntity objects from arbitrary streams.

The parser is built on top of a MimeReader, and the protected On* methods mirror the MimeReader callbacks so that subclasses can observe the parsing process (for example, to record the stream offsets of each entity). Overrides must call the base implementation or the parser will not be able to construct the resulting MimeMessage or MimeEntity.

Constructors

MimeParser(Stream, MimeContentStorage) Initialize a new instance of the MimeParser class.
MimeParser(ParserOptions, Stream, MimeContentStorage) Initialize a new instance of the MimeParser class.
MimeParser(Stream, MimeFormat, MimeContentStorage) Initialize a new instance of the MimeParser class.
MimeParser(ParserOptions, Stream, MimeFormat, MimeContentStorage) Initialize a new instance of the MimeParser class.

Properties

ComplianceLogger Get or set the logger to use for reporting MIME compliance violations.
ComplianceOptions Get or set the options that control how MIME compliance violations are reported.
IsEndOfStream Get a value indicating whether the parser has reached the end of the input stream.
MboxMarker Get the mbox marker for the most recently parsed message.
MboxMarkerOffset Get the mbox marker stream offset for the most recently parsed message.
Options Get or set the parser options.
Position Get the current position of the parser within the stream.

Methods

Equals Determines whether the specified object is equal to the current object.
(Inherited from Object)
Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetHashCode Serves as the default hash function.
(Inherited from Object)
GetType Gets the Type of the current instance.
(Inherited from Object)
MemberwiseClone Creates a shallow copy of the current Object.
(Inherited from Object)
OnBodySeparator Called when the body separator is encountered in the stream.
OnBodySeparatorAsync Called when the body separator is encountered in the stream.
OnHeaderRead Called when a message or MIME part header is read from the stream.
OnHeaderReadAsync Called when a message or MIME part header is read from the stream.
OnHeadersBegin Called when the beginning of a list of headers is encountered in the stream.
OnHeadersBeginAsync Called when the beginning of a list of headers is encountered in the stream.
OnHeadersEnd Called when the end of a list of headers is encountered in the stream.
OnHeadersEndAsync Called when the end of a list of headers is encountered in the stream.
OnMboxMarkerBegin Called when an Mbox marker is encountered in the stream.
OnMboxMarkerBeginAsync Called when an Mbox marker is encountered in the stream.
OnMboxMarkerEnd Called when the end of an Mbox marker is encountered in the stream.
OnMboxMarkerEndAsync Called when the end of an Mbox marker is encountered in the stream.
OnMboxMarkerRead Called when an Mbox marker is encountered in the stream.
OnMboxMarkerReadAsync Called when an Mbox marker is encountered in the stream.
OnMessagePartBegin Called when the beginning of a message part is encountered in the stream.
OnMessagePartBeginAsync Called when the beginning of a message part is encountered in the stream.
OnMessagePartEnd Called when the end of a message part is encountered in the stream.
OnMessagePartEndAsync Called when the end of a message part is encountered in the stream.
OnMimeMessageBegin Called when the beginning of a message is encountered in the stream.
OnMimeMessageBeginAsync Called when the beginning of a message is encountered in the stream.
OnMimeMessageEnd Called when the end of a message is encountered in the stream.
OnMimeMessageEndAsync Called when the end of a message is encountered in the stream.
OnMimePartBegin Called when the beginning of a MIME part is encountered in the stream.
OnMimePartBeginAsync Called when the beginning of a MIME part is encountered in the stream.
OnMimePartContentBegin Called when the beginning of a MIME part's content is encountered in the stream.
OnMimePartContentBeginAsync Called when the beginning of a MIME part's content is encountered in the stream.
OnMimePartContentEnd Called when the end of a MIME part's content is encountered in the stream.
OnMimePartContentEndAsync Called when the end of a MIME part's content is encountered in the stream.
OnMimePartContentRead Called when MIME part content is read from the stream.
OnMimePartContentReadAsync Called when MIME part content is read from the stream.
OnMimePartEnd Called when the end of a MIME part is encountered in the stream.
OnMimePartEndAsync Called when the end of a MIME part is encountered in the stream.
OnMultipartBegin Called when the beginning of a multipart is encountered in the stream.
OnMultipartBeginAsync Called when the beginning of a multipart is encountered in the stream.
OnMultipartBoundaryBegin Called when a multipart boundary is encountered in the stream.
OnMultipartBoundaryBeginAsync Called when a multipart boundary is encountered in the stream.
OnMultipartBoundaryEnd Called when a multipart boundary is encountered in the stream.
OnMultipartBoundaryEndAsync Called when a multipart boundary is encountered in the stream.
OnMultipartBoundaryRead Called when a multipart boundary is encountered in the stream.
OnMultipartBoundaryReadAsync Called when a multipart boundary is encountered in the stream.
OnMultipartEnd Called when the end of a multipart is encountered in the stream.
OnMultipartEndAsync Called when the end of a multipart is encountered in the stream.
OnMultipartEndBoundaryBegin Called when a multipart end boundary is encountered in the stream.
OnMultipartEndBoundaryBeginAsync Called when a multipart end boundary is encountered in the stream.
OnMultipartEndBoundaryEnd Called when a multipart end boundary is encountered in the stream.
OnMultipartEndBoundaryEndAsync Called when a multipart end boundary is encountered in the stream.
OnMultipartEndBoundaryRead Called when a multipart end boundary is encountered in the stream.
OnMultipartEndBoundaryReadAsync Called when a multipart end boundary is encountered in the stream.
OnMultipartEpilogueBegin Called when the beginning of the epilogue of a multipart is encountered in the stream.
OnMultipartEpilogueBeginAsync Called when the beginning of the epilogue of a multipart is encountered in the stream.
OnMultipartEpilogueEnd Called when the end of the epilogue of a multipart is encountered in the stream.
OnMultipartEpilogueEndAsync Called when the end of the epilogue of a multipart is encountered in the stream.
OnMultipartEpilogueRead Called when multipart epilogue text is read from the stream.
OnMultipartEpilogueReadAsync Called when multipart epilogue text is read from the stream.
OnMultipartPreambleBegin Called when the beginning of the preamble of a multipart is encountered in the stream.
OnMultipartPreambleBeginAsync Called when the beginning of the preamble of a multipart is encountered in the stream.
OnMultipartPreambleEnd Called when the end of the preamble of a multipart is encountered in the stream.
OnMultipartPreambleEndAsync Called when the end of the preamble of a multipart is encountered in the stream.
OnMultipartPreambleRead Called when multipart preamble text is read from the stream.
OnMultipartPreambleReadAsync Called when multipart preamble text is read from the stream.
ParseEntity Parse an entity from the stream.
ParseEntityAsync Asynchronously parse an entity from the stream.
ParseHeaders Parse a list of headers from the stream.
ParseHeadersAsync Asynchronously parse a list of headers from the stream.
ParseMessage Parse a message from the stream.
ParseMessageAsync Asynchronously parse a message from the stream.
SetStream(Stream, MimeContentStorage) Set the stream to parse.
SetStream(Stream, MimeFormat) Set the stream to parse.
SetStream(Stream, MimeFormat, MimeContentStorage) Set the stream to parse.
ToString Returns a string that represents the current object.
(Inherited from Object)

See Also

Reference