C# Class Microsoft.Legal.MatterCenter.Utility.MailMimeReader

Reads MIME based emails streams and files.
Inheritance: IDisposable
Afficher le fichier Open project: Microsoft/mattercenter Class Usage Examples

Méthodes publiques

Méthode Description
ConvertToDateTime ( string date ) : System.DateTime

Tries to convert string to date If there is a run time error, the smallest possible date is returned

ConvertToMailAddress ( string address ) : System.Net.Mail.MailAddress

Tries to convert a string into an email address

DecodeByteArrayToString ( byte byteArray, Encoding byteEncoding ) : string

Converts byte array to string, using decoding as requested

Dispose ( ) : void

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

GetEmail ( Stream emailStream ) : MailMessageParser

Gets an email from the supplied Email Stream and processes it.

GetEmail ( string mailPath ) : MailMessageParser

Gets an email from the supplied Email Stream and processes it.

MailMimeReader ( ) : System

Initializes a new instance of the MailMimeReader class

ProcessReceivedDate ( string headerValue ) : System.DateTime

To process received date from the header field

Méthodes protégées

Méthode Description
Dispose ( bool disposing ) : void

Releases unmanaged and - optionally - managed resources.

ReadMultipleLine ( string &response ) : bool

read one line in multiline mode from the Email stream.

Private Methods

Méthode Description
AddChildPartsToParent ( MailMessageParser child, MailMessageParser parent ) : void

Add all attachments and alternative views from child to the parent

AddMailAddresses ( string addresses, MailAddressCollection addressCollection ) : void

find individual addresses in the string and add it to address collection

ConvertToTransferEncoding ( string transferEncodingString ) : TransferEncoding

converts TransferEncoding as defined in the RFC into a .NET TransferEncoding .NET doesn't know the type "bit8". It is translated here into "bit7", which requires the same kind of processing (none).

ParentBoundaryFound ( string response, string parentBoundaryStart, string parentBoundaryEnd, MimeEntityReturnCode &boundaryMimeReturnCode ) : bool

Check if the response line received is a parent boundary

ProcessDelimitedBody ( MailMessageParser message, string boundaryStart, string parentBoundaryStart, string parentBoundaryEnd ) : MimeEntityReturnCode

Processes the delimited body of Mail Mime Entity.

ProcessHeaderField ( MailMessageParser message, string headerField ) : void

Convert one MIME header field and update message accordingly

ProcessMimeEntity ( MailMessageParser message, string parentBoundaryStart ) : MimeEntityReturnCode

Process a MIME entity A MIME entity consists of header and body. Separator lines in the body might mark children MIME entities

RemoveBrackets ( string parameterString ) : string

removes leading '<' and trailing '>' if both exist

SaveAttachment ( MailMessageParser message ) : void

each attachment is stored in its own MIME entity and read into this entity's ContentStream. SaveAttachment creates an attachment out of the ContentStream and attaches it to the parent MIME entity.

SaveMessageBody ( MailMessageParser message, string contentString ) : void

Copies the content found for the MIME entity to the MailMessageParser body and creates a stream which can be used to create attachments and alternative views.

Method Details

ConvertToDateTime() public méthode

Tries to convert string to date If there is a run time error, the smallest possible date is returned
public ConvertToDateTime ( string date ) : System.DateTime
date string string to be converted to Date object
Résultat System.DateTime

ConvertToMailAddress() public static méthode

Tries to convert a string into an email address
public static ConvertToMailAddress ( string address ) : System.Net.Mail.MailAddress
address string string mail address to parse
Résultat System.Net.Mail.MailAddress

DecodeByteArrayToString() public static méthode

Converts byte array to string, using decoding as requested
public static DecodeByteArrayToString ( byte byteArray, Encoding byteEncoding ) : string
byteArray byte Stream byte array.
byteEncoding System.Text.Encoding byte encoding to use
Résultat string

Dispose() public méthode

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
Résultat void

Dispose() protected méthode

Releases unmanaged and - optionally - managed resources.
protected Dispose ( bool disposing ) : void
disposing bool true to release both managed and unmanaged resources; false to release only unmanaged resources.
Résultat void

GetEmail() public méthode

Gets an email from the supplied Email Stream and processes it.
public GetEmail ( Stream emailStream ) : MailMessageParser
emailStream Stream The email stream object
Résultat MailMessageParser

GetEmail() public méthode

Gets an email from the supplied Email Stream and processes it.
public GetEmail ( string mailPath ) : MailMessageParser
mailPath string string that designates the path to a .EML file
Résultat MailMessageParser

MailMimeReader() public méthode

Initializes a new instance of the MailMimeReader class
public MailMimeReader ( ) : System
Résultat System

ProcessReceivedDate() public méthode

To process received date from the header field
public ProcessReceivedDate ( string headerValue ) : System.DateTime
headerValue string Header value from the headers of the mail
Résultat System.DateTime

ReadMultipleLine() protected méthode

read one line in multiline mode from the Email stream.
protected ReadMultipleLine ( string &response ) : bool
response string line received
Résultat bool