Mime4.net Home | Community Edition | Order | Usage examples | Feedback
IContentHandler InterfaceMIME4NET Class Library Documentation

Receives notifications of the content of a plain RFC822 or MIME message. Implement this interface and register an instance of that implementation with a MimeStreamParser instance using its {@link org.mime4j.MimeStreamParser#setContentHandler(ContentHandler)} method. The parser uses the ContentHandler instance to report basic message-related events like the start and end of the body of a part in a multipart MIME entity.

Events will be generated in the order the corresponding elements occur in the message stream parsed by the parser. E.g.:

startMessage()
    startHeader()
        field(...)
        field(...)
        ...
    endHeader()
    startMultipart()
        preamble(...)
        startBodyPart()
            startHeader()
                field(...)
                field(...)
                ...
            endHeader()
            body()
        endBodyPart()
        startBodyPart()
            startHeader()
                field(...)
                field(...)
                ...
            endHeader()
            body()
        endBodyPart()
        epilogue(...)
    endMultipart()
endMessage()
The above shows an example of a MIME message consisting of a multipart body containing two body parts.

See MIME RFCs 2045-2049 for more information on the structure of MIME messages and RFC 822 and 2822 for the general structure of Internet mail messages.

Namespace: NI.Email.Mime
Assembly: NI.Email.Mime (in NI.Email.Mime.dll) Version: 1.8.5168.22709
Syntax

public interface IContentHandler

The IContentHandler type exposes the following members.

Methods

  NameDescription
Public methodBody
Called when the body of a discrete (non-multipart) entity is about to be parsed.
Public methodEndBodyPart
Called when a body part ends.
Public methodEndHeader
Called when there are no more header fields in a message or body part.
Public methodEndMessage
Called when a message ends.
Public methodEndMultipart
Called when the body of an entity has been parsed.
Public methodEpilogue
Called for the epilogue (whatever comes after the final body part) of a multipart/* entity.
Public methodField
Called for each field of a header.
Public methodPreamble
Called for the preamble (whatever comes before the first body part) of a multipart/* entity.
Public methodRaw
Called when a new entity (message or body part) starts and the parser is in raw mode.
Public methodStartBodyPart
Called when a new body part starts inside a multipart/* entity.
Public methodStartHeader
Called when a header (of a message or body part) is about to be parsed.
Public methodStartMessage
Called when a new message starts (a top level message or an embedded rfc822 message).
Public methodStartMultipart
Called when the body of a multipart entity is about to be parsed.
Top
See Also