C# Class MimeKit.MimeMessage

A MIME message.

A message consists of header fields and, optionally, a body.

The body of the message can either be plain text or it can be a tree of MIME entities such as a text/plain MIME part and a collection of file attachments.

Show file Open project: jstedfast/MimeKit Class Usage Examples

Private Properties

Property Type Description
AddAddresses void
DkimGetDigestSigner ISigner
DkimHashBody byte[]
DkimWriteHeaderRelaxed void
DkimWriteHeaderSimple void
DkimWriteHeaders void
EnumerateMimeParts IEnumerable
GetMessageRecipients IList
GetMessageSigner MimeKit.MailboxAddress
GetMimePart MimePart
GetSignedDkimSignatureHeader Header
HeadersChanged void
InternetAddressListChanged void
IsWhiteSpace bool
MergeHeaders IEnumerable
MimeMessage System
MimeMessage System
ParseDkimSignature string>.IDictionary
ReferencesChanged void
ReloadAddressList void
ReloadHeader void
RemoveHeader void
ReplaceHeader void
SerializeAddressList void
SetHeader void
Sign void
TryGetMultipartBody bool
ValidateDkimSignatureParameters void

Public Methods

Method Description
Accept ( MimeKit.MimeVisitor visitor ) : void

Dispatches to the specific visit method for this MIME message.

This default implementation for MimeKit.MimeMessage nodes calls MimeKit.MimeVisitor.VisitMimeMessage. Override this method to call into a more specific method on a derived visitor class of the MimeKit.MimeVisitor class. However, it should still support unknown visitors by calling MimeKit.MimeVisitor.VisitMimeMessage.

CreateFromMailMessage ( MailMessage message ) : MimeMessage

Creates a new MimeMessage from a System.Net.Mail.MailMessage.

Creates a new MimeMessage from a System.Net.Mail.MailMessage.

Encrypt ( MimeKit.Cryptography.CryptographyContext ctx ) : void

Encrypt the message to the sender and all of the recipients using the specified cryptography context.

If either of the Resent-Sender or Resent-From headers are set, then the message will be encrypted to all of the addresses specified in the Resent headers (Resent-Sender, Resent-From, Resent-To, Resent-Cc, and Resent-Bcc), otherwise the message will be encrypted to all of the addresses specified in the standard address headers (Sender, From, To, Cc, and Bcc).

GetTextBody ( TextFormat format ) : string

Gets the text body in the specified format.

Gets the text body in the specified format, if it exists.

Load ( ParserOptions options, Stream stream, CancellationToken cancellationToken = default(CancellationToken) ) : MimeMessage

Load a MimeMessage from the specified stream.

Loads a MimeMessage from the given stream, using the specified ParserOptions.

Load ( ParserOptions options, Stream stream, bool persistent, CancellationToken cancellationToken = default(CancellationToken) ) : MimeMessage

Load a MimeMessage from the specified stream.

Loads a MimeMessage from the given stream, using the specified ParserOptions.

If persistent is true and stream is seekable, then the MimeParser will not copy the content of MimeParts into memory. Instead, it will use a MimeKit.IO.BoundStream to reference a substream of stream. This has the potential to not only save mmeory usage, but also improve MimeParser performance.

Load ( ParserOptions options, string fileName, CancellationToken cancellationToken = default(CancellationToken) ) : MimeMessage

Load a MimeMessage from the specified file.

Loads a MimeMessage from the file at the given path, using the specified ParserOptions.

Load ( Stream stream, CancellationToken cancellationToken = default(CancellationToken) ) : MimeMessage

Load a MimeMessage from the specified stream.

Loads a MimeMessage from the given stream, using the default ParserOptions.

Load ( Stream stream, bool persistent, CancellationToken cancellationToken = default(CancellationToken) ) : MimeMessage

Load a MimeMessage from the specified stream.

Loads a MimeMessage from the given stream, using the default ParserOptions.

If persistent is true and stream is seekable, then the MimeParser will not copy the content of MimeParts into memory. Instead, it will use a MimeKit.IO.BoundStream to reference a substream of stream. This has the potential to not only save mmeory usage, but also improve MimeParser performance.

Load ( string fileName, CancellationToken cancellationToken = default(CancellationToken) ) : MimeMessage

Load a MimeMessage from the specified file.

Loads a MimeMessage from the file at the given path, using the default ParserOptions.

MimeMessage ( ) : System

Initializes a new instance of the MimeKit.MimeMessage class.

Creates a new MimeMessage.

MimeMessage ( IEnumerable from, IEnumerable to, string subject, MimeKit.MimeEntity body ) : System

Initializes a new instance of the MimeKit.MimeMessage class.

Creates a new MIME message, specifying details at creation time.

Prepare ( EncodingConstraint constraint, int maxLineLength = 78 ) : void

Prepare the message for transport using the specified encoding constraints.

Prepares the message for transport using the specified encoding constraints.

Sign ( MimeKit.Cryptography.CryptographyContext ctx ) : void

Sign the message using the specified cryptography context and the SHA-1 digest algorithm.

If either of the Resent-Sender or Resent-From headers are set, then the message will be signed using the Resent-Sender (or first mailbox in the Resent-From) address as the signer address, otherwise the Sender or From address will be used instead.

Sign ( MimeKit.Cryptography.CryptographyContext ctx, DigestAlgorithm digestAlgo ) : void

Sign the message using the specified cryptography context and digest algorithm.

If either of the Resent-Sender or Resent-From headers are set, then the message will be signed using the Resent-Sender (or first mailbox in the Resent-From) address as the signer address, otherwise the Sender or From address will be used instead.

Sign ( MimeKit.Cryptography.DkimSigner signer, IList headers, DkimCanonicalizationAlgorithm headerCanonicalizationAlgorithm = DkimCanonicalizationAlgorithm.Simple, DkimCanonicalizationAlgorithm bodyCanonicalizationAlgorithm = DkimCanonicalizationAlgorithm.Simple ) : void

Digitally sign the message using a DomainKeys Identified Mail (DKIM) signature.

Digitally signs the message using a DomainKeys Identified Mail (DKIM) signature.

SignAndEncrypt ( MimeKit.Cryptography.CryptographyContext ctx ) : void

Sign and encrypt the message to the sender and all of the recipients using the specified cryptography context and the SHA-1 digest algorithm.

If either of the Resent-Sender or Resent-From headers are set, then the message will be signed using the Resent-Sender (or first mailbox in the Resent-From) address as the signer address, otherwise the Sender or From address will be used instead.

Likewise, if either of the Resent-Sender or Resent-From headers are set, then the message will be encrypted to all of the addresses specified in the Resent headers (Resent-Sender, Resent-From, Resent-To, Resent-Cc, and Resent-Bcc), otherwise the message will be encrypted to all of the addresses specified in the standard address headers (Sender, From, To, Cc, and Bcc).

SignAndEncrypt ( MimeKit.Cryptography.CryptographyContext ctx, DigestAlgorithm digestAlgo ) : void

Sign and encrypt the message to the sender and all of the recipients using the specified cryptography context and the specified digest algorithm.

If either of the Resent-Sender or Resent-From headers are set, then the message will be signed using the Resent-Sender (or first mailbox in the Resent-From) address as the signer address, otherwise the Sender or From address will be used instead.

Likewise, if either of the Resent-Sender or Resent-From headers are set, then the message will be encrypted to all of the addresses specified in the Resent headers (Resent-Sender, Resent-From, Resent-To, Resent-Cc, and Resent-Bcc), otherwise the message will be encrypted to all of the addresses specified in the standard address headers (Sender, From, To, Cc, and Bcc).

ToString ( ) : string

Returns a System.String that represents the current MimeKit.MimeMessage.

Returns a System.String that represents the current MimeKit.MimeMessage.

Note: In general, the string returned from this method SHOULD NOT be used for serializing the message to disk. It is recommended that you use WriteTo(Stream,CancellationToken) instead.

Verify ( MimeKit.FormatOptions options, Header dkimSignature, IDkimPublicKeyLocator publicKeyLocator, CancellationToken cancellationToken = default(CancellationToken) ) : bool

Verify the specified DKIM-Signature header.

Verifies the specified DKIM-Signature header.

Verify ( Header dkimSignature, IDkimPublicKeyLocator publicKeyLocator, CancellationToken cancellationToken = default(CancellationToken) ) : bool

Verify the specified DKIM-Signature header.

Verifies the specified DKIM-Signature header.

WriteTo ( MimeKit.FormatOptions options, Stream stream, CancellationToken cancellationToken = default(CancellationToken) ) : void

Writes the message to the specified output stream.

Writes the message to the output stream using the provided formatting options.

WriteTo ( MimeKit.FormatOptions options, string fileName, CancellationToken cancellationToken = default(CancellationToken) ) : void

Writes the message to the specified file.

Writes the message to the specified file using the provided formatting options.

WriteTo ( Stream stream, CancellationToken cancellationToken = default(CancellationToken) ) : void

Writes the message to the specified output stream.

Writes the message to the output stream using the default formatting options.

WriteTo ( string fileName, CancellationToken cancellationToken = default(CancellationToken) ) : void

Writes the message to the specified file.

Writes the message to the specified file using the default formatting options.

Private Methods

Method Description
AddAddresses ( Header header, InternetAddressList list ) : void
DkimGetDigestSigner ( DkimSignatureAlgorithm algorithm, AsymmetricKeyParameter key ) : ISigner
DkimHashBody ( MimeKit.FormatOptions options, DkimSignatureAlgorithm signatureAlgorithm, DkimCanonicalizationAlgorithm bodyCanonicalizationAlgorithm, int maxLength ) : byte[]
DkimWriteHeaderRelaxed ( MimeKit.FormatOptions options, Stream stream, Header header, bool isDkimSignature ) : void
DkimWriteHeaderSimple ( MimeKit.FormatOptions options, Stream stream, Header header, bool isDkimSignature ) : void
DkimWriteHeaders ( MimeKit.FormatOptions options, IList fields, DkimCanonicalizationAlgorithm headerCanonicalizationAlgorithm, Stream stream ) : void
EnumerateMimeParts ( MimeKit.MimeEntity entity ) : IEnumerable
GetMessageRecipients ( bool includeSenders ) : IList
GetMessageSigner ( ) : MimeKit.MailboxAddress
GetMimePart ( System.Net.Mail.AttachmentBase item ) : MimePart
GetSignedDkimSignatureHeader ( Header dkimSignature ) : Header
HeadersChanged ( object o, MimeKit.HeaderListChangedEventArgs e ) : void
InternetAddressListChanged ( object addrlist, EventArgs e ) : void
IsWhiteSpace ( char c ) : bool
MergeHeaders ( ) : IEnumerable
MimeMessage ( ParserOptions options ) : System
MimeMessage ( ParserOptions options, IEnumerable
headers ) : System
ParseDkimSignature ( string signature ) : string>.IDictionary
ReferencesChanged ( object o, EventArgs e ) : void
ReloadAddressList ( HeaderId id, InternetAddressList list ) : void
ReloadHeader ( HeaderId id ) : void
RemoveHeader ( HeaderId id ) : void
ReplaceHeader ( HeaderId id, string name, byte raw ) : void
SerializeAddressList ( string field, InternetAddressList list ) : void
SetHeader ( string name, string value ) : void
Sign ( MimeKit.FormatOptions options, MimeKit.Cryptography.DkimSigner signer, IList headers, DkimCanonicalizationAlgorithm headerCanonicalizationAlgorithm = DkimCanonicalizationAlgorithm.Simple, DkimCanonicalizationAlgorithm bodyCanonicalizationAlgorithm = DkimCanonicalizationAlgorithm.Simple ) : void

Digitally sign the message using a DomainKeys Identified Mail (DKIM) signature.

Digitally signs the message using a DomainKeys Identified Mail (DKIM) signature.

TryGetMultipartBody ( Multipart multipart, TextFormat format, string &body ) : bool
ValidateDkimSignatureParameters ( string>.IDictionary parameters, DkimSignatureAlgorithm &algorithm, DkimCanonicalizationAlgorithm &headerAlgorithm, DkimCanonicalizationAlgorithm &bodyAlgorithm, string &d, string &s, string &q, string &headers, string &bh, string &b, int &maxLength ) : void

Method Details

Accept() public method

Dispatches to the specific visit method for this MIME message.
This default implementation for MimeKit.MimeMessage nodes calls MimeKit.MimeVisitor.VisitMimeMessage. Override this method to call into a more specific method on a derived visitor class of the MimeKit.MimeVisitor class. However, it should still support unknown visitors by calling MimeKit.MimeVisitor.VisitMimeMessage.
/// is null. ///
public Accept ( MimeKit.MimeVisitor visitor ) : void
visitor MimeKit.MimeVisitor The visitor.
return void

CreateFromMailMessage() public static method

Creates a new MimeMessage from a System.Net.Mail.MailMessage.
Creates a new MimeMessage from a System.Net.Mail.MailMessage.
/// is null. ///
public static CreateFromMailMessage ( MailMessage message ) : MimeMessage
message System.Net.Mail.MailMessage The message.
return MimeMessage

Encrypt() public method

Encrypt the message to the sender and all of the recipients using the specified cryptography context.
If either of the Resent-Sender or Resent-From headers are set, then the message will be encrypted to all of the addresses specified in the Resent headers (Resent-Sender, Resent-From, Resent-To, Resent-Cc, and Resent-Bcc), otherwise the message will be encrypted to all of the addresses specified in the standard address headers (Sender, From, To, Cc, and Bcc).
/// is null. /// /// An unknown type of cryptography context was used. /// /// The has not been set. /// -or- /// No recipients have been specified. /// /// A certificate could not be found for one or more of the recipients. /// /// The public key could not be found for one or more of the recipients. ///
public Encrypt ( MimeKit.Cryptography.CryptographyContext ctx ) : void
ctx MimeKit.Cryptography.CryptographyContext The cryptography context.
return void

GetTextBody() public method

Gets the text body in the specified format.
Gets the text body in the specified format, if it exists.
public GetTextBody ( TextFormat format ) : string
format TextFormat The desired text format.
return string

Load() public static method

Load a MimeMessage from the specified stream.
Loads a MimeMessage from the given stream, using the specified ParserOptions.
/// is null. /// -or- /// is null. /// /// The operation was canceled via the cancellation token. /// /// There was an error parsing the entity. /// /// An I/O error occurred. ///
public static Load ( ParserOptions options, Stream stream, CancellationToken cancellationToken = default(CancellationToken) ) : MimeMessage
options ParserOptions The parser options.
stream Stream The stream.
cancellationToken System.Threading.CancellationToken A cancellation token.
return MimeMessage

Load() public static method

Load a MimeMessage from the specified stream.

Loads a MimeMessage from the given stream, using the specified ParserOptions.

If persistent is true and stream is seekable, then the MimeParser will not copy the content of MimeParts into memory. Instead, it will use a MimeKit.IO.BoundStream to reference a substream of stream. This has the potential to not only save mmeory usage, but also improve MimeParser performance.

/// is null. /// -or- /// is null. /// /// The operation was canceled via the cancellation token. /// /// There was an error parsing the entity. /// /// An I/O error occurred. ///
public static Load ( ParserOptions options, Stream stream, bool persistent, CancellationToken cancellationToken = default(CancellationToken) ) : MimeMessage
options ParserOptions The parser options.
stream Stream The stream.
persistent bool true if the stream is persistent; otherwise false.
cancellationToken System.Threading.CancellationToken A cancellation token.
return MimeMessage

Load() public static method

Load a MimeMessage from the specified file.
Loads a MimeMessage from the file at the given path, using the specified ParserOptions.
/// is null. /// -or- /// is null. /// /// is a zero-length string, contains only white space, or /// contains one or more invalid characters as defined by /// . /// /// is an invalid file path. /// /// The specified file path could not be found. /// /// The user does not have access to read the specified file. /// /// The operation was canceled via the cancellation token. /// /// There was an error parsing the entity. /// /// An I/O error occurred. ///
public static Load ( ParserOptions options, string fileName, CancellationToken cancellationToken = default(CancellationToken) ) : MimeMessage
options ParserOptions The parser options.
fileName string The name of the file to load.
cancellationToken System.Threading.CancellationToken A cancellation token.
return MimeMessage

Load() public static method

Load a MimeMessage from the specified stream.
Loads a MimeMessage from the given stream, using the default ParserOptions.
/// is null. /// /// The operation was canceled via the cancellation token. /// /// There was an error parsing the entity. /// /// An I/O error occurred. ///
public static Load ( Stream stream, CancellationToken cancellationToken = default(CancellationToken) ) : MimeMessage
stream Stream The stream.
cancellationToken System.Threading.CancellationToken A cancellation token.
return MimeMessage

Load() public static method

Load a MimeMessage from the specified stream.

Loads a MimeMessage from the given stream, using the default ParserOptions.

If persistent is true and stream is seekable, then the MimeParser will not copy the content of MimeParts into memory. Instead, it will use a MimeKit.IO.BoundStream to reference a substream of stream. This has the potential to not only save mmeory usage, but also improve MimeParser performance.

/// is null. /// /// The operation was canceled via the cancellation token. /// /// There was an error parsing the entity. /// /// An I/O error occurred. ///
public static Load ( Stream stream, bool persistent, CancellationToken cancellationToken = default(CancellationToken) ) : MimeMessage
stream Stream The stream.
persistent bool true if the stream is persistent; otherwise false.
cancellationToken System.Threading.CancellationToken A cancellation token.
return MimeMessage

Load() public static method

Load a MimeMessage from the specified file.
Loads a MimeMessage from the file at the given path, using the default ParserOptions.
/// is null. /// /// is a zero-length string, contains only white space, or /// contains one or more invalid characters as defined by /// . /// /// is an invalid file path. /// /// The specified file path could not be found. /// /// The user does not have access to read the specified file. /// /// The operation was canceled via the cancellation token. /// /// There was an error parsing the entity. /// /// An I/O error occurred. ///
public static Load ( string fileName, CancellationToken cancellationToken = default(CancellationToken) ) : MimeMessage
fileName string The name of the file to load.
cancellationToken System.Threading.CancellationToken A cancellation token.
return MimeMessage

MimeMessage() public method

Initializes a new instance of the MimeKit.MimeMessage class.
Creates a new MimeMessage.
/// is null. /// /// contains more than one . /// -or- /// contains one or more arguments of an unknown type. ///
public MimeMessage ( ) : System
return System

MimeMessage() public method

Initializes a new instance of the MimeKit.MimeMessage class.
Creates a new MIME message, specifying details at creation time.
public MimeMessage ( IEnumerable from, IEnumerable to, string subject, MimeKit.MimeEntity body ) : System
from IEnumerable The list of addresses in the From header.
to IEnumerable The list of addresses in the To header.
subject string The subject of the message.
body MimeKit.MimeEntity The body of the message.
return System

Prepare() public method

Prepare the message for transport using the specified encoding constraints.
Prepares the message for transport using the specified encoding constraints.
/// is not between 60 and 998 (inclusive). /// -or- /// is not a valid value. ///
public Prepare ( EncodingConstraint constraint, int maxLineLength = 78 ) : void
constraint EncodingConstraint The encoding constraint.
maxLineLength int The maximum allowable length for a line (not counting the CRLF). Must be between 60 and 998 (inclusive).
return void

Sign() public method

Sign the message using the specified cryptography context and the SHA-1 digest algorithm.
If either of the Resent-Sender or Resent-From headers are set, then the message will be signed using the Resent-Sender (or first mailbox in the Resent-From) address as the signer address, otherwise the Sender or From address will be used instead.
/// is null. /// /// The has not been set. /// -or- /// A sender has not been specified. /// /// A signing certificate could not be found for the sender. /// /// The private key could not be found for the sender. ///
public Sign ( MimeKit.Cryptography.CryptographyContext ctx ) : void
ctx MimeKit.Cryptography.CryptographyContext The cryptography context.
return void

Sign() public method

Sign the message using the specified cryptography context and digest algorithm.
If either of the Resent-Sender or Resent-From headers are set, then the message will be signed using the Resent-Sender (or first mailbox in the Resent-From) address as the signer address, otherwise the Sender or From address will be used instead.
/// is null. /// /// The has not been set. /// -or- /// A sender has not been specified. /// /// The was out of range. /// /// The is not supported. /// /// A signing certificate could not be found for the sender. /// /// The private key could not be found for the sender. ///
public Sign ( MimeKit.Cryptography.CryptographyContext ctx, DigestAlgorithm digestAlgo ) : void
ctx MimeKit.Cryptography.CryptographyContext The cryptography context.
digestAlgo DigestAlgorithm The digest algorithm.
return void

Sign() public method

Digitally sign the message using a DomainKeys Identified Mail (DKIM) signature.
Digitally signs the message using a DomainKeys Identified Mail (DKIM) signature.
/// is null. /// -or- /// is null. /// /// does not contain the 'From' header. /// -or- /// contains one or more of the following headers: Return-Path, /// Received, Comments, Keywords, Bcc, Resent-Bcc, or DKIM-Signature. ///
public Sign ( MimeKit.Cryptography.DkimSigner signer, IList headers, DkimCanonicalizationAlgorithm headerCanonicalizationAlgorithm = DkimCanonicalizationAlgorithm.Simple, DkimCanonicalizationAlgorithm bodyCanonicalizationAlgorithm = DkimCanonicalizationAlgorithm.Simple ) : void
signer MimeKit.Cryptography.DkimSigner The DKIM signer.
headers IList The headers to sign.
headerCanonicalizationAlgorithm DkimCanonicalizationAlgorithm The header canonicalization algorithm.
bodyCanonicalizationAlgorithm DkimCanonicalizationAlgorithm The body canonicalization algorithm.
return void

SignAndEncrypt() public method

Sign and encrypt the message to the sender and all of the recipients using the specified cryptography context and the SHA-1 digest algorithm.

If either of the Resent-Sender or Resent-From headers are set, then the message will be signed using the Resent-Sender (or first mailbox in the Resent-From) address as the signer address, otherwise the Sender or From address will be used instead.

Likewise, if either of the Resent-Sender or Resent-From headers are set, then the message will be encrypted to all of the addresses specified in the Resent headers (Resent-Sender, Resent-From, Resent-To, Resent-Cc, and Resent-Bcc), otherwise the message will be encrypted to all of the addresses specified in the standard address headers (Sender, From, To, Cc, and Bcc).

/// is null. /// /// An unknown type of cryptography context was used. /// /// The has not been set. /// -or- /// The sender has been specified. /// -or- /// No recipients have been specified. /// /// A certificate could not be found for the signer or one or more of the recipients. /// /// The private key could not be found for the sender. /// /// The public key could not be found for one or more of the recipients. ///
public SignAndEncrypt ( MimeKit.Cryptography.CryptographyContext ctx ) : void
ctx MimeKit.Cryptography.CryptographyContext The cryptography context.
return void

SignAndEncrypt() public method

Sign and encrypt the message to the sender and all of the recipients using the specified cryptography context and the specified digest algorithm.

If either of the Resent-Sender or Resent-From headers are set, then the message will be signed using the Resent-Sender (or first mailbox in the Resent-From) address as the signer address, otherwise the Sender or From address will be used instead.

Likewise, if either of the Resent-Sender or Resent-From headers are set, then the message will be encrypted to all of the addresses specified in the Resent headers (Resent-Sender, Resent-From, Resent-To, Resent-Cc, and Resent-Bcc), otherwise the message will be encrypted to all of the addresses specified in the standard address headers (Sender, From, To, Cc, and Bcc).

/// is null. /// /// An unknown type of cryptography context was used. /// /// The was out of range. /// /// The has not been set. /// -or- /// The sender has been specified. /// -or- /// No recipients have been specified. /// /// The is not supported. /// /// A certificate could not be found for the signer or one or more of the recipients. /// /// The private key could not be found for the sender. /// /// The public key could not be found for one or more of the recipients. ///
public SignAndEncrypt ( MimeKit.Cryptography.CryptographyContext ctx, DigestAlgorithm digestAlgo ) : void
ctx MimeKit.Cryptography.CryptographyContext The cryptography context.
digestAlgo DigestAlgorithm The digest algorithm.
return void

ToString() public method

Returns a System.String that represents the current MimeKit.MimeMessage.

Returns a System.String that represents the current MimeKit.MimeMessage.

Note: In general, the string returned from this method SHOULD NOT be used for serializing the message to disk. It is recommended that you use WriteTo(Stream,CancellationToken) instead.

public ToString ( ) : string
return string

Verify() public method

Verify the specified DKIM-Signature header.
Verifies the specified DKIM-Signature header.
/// is null. /// -or- /// is null. /// -or- /// is null. /// /// is not a DKIM-Signature header. /// /// The DKIM-Signature header value is malformed. /// /// The operation was canceled via the cancellation token. ///
public Verify ( MimeKit.FormatOptions options, Header dkimSignature, IDkimPublicKeyLocator publicKeyLocator, CancellationToken cancellationToken = default(CancellationToken) ) : bool
options MimeKit.FormatOptions The formatting options.
dkimSignature Header The DKIM-Signature header.
publicKeyLocator IDkimPublicKeyLocator The public key locator service.
cancellationToken System.Threading.CancellationToken The cancellation token.
return bool

Verify() public method

Verify the specified DKIM-Signature header.
Verifies the specified DKIM-Signature header.
/// is null. /// -or- /// is null. /// /// is not a DKIM-Signature header. /// /// The DKIM-Signature header value is malformed. /// /// The operation was canceled via the cancellation token. ///
public Verify ( Header dkimSignature, IDkimPublicKeyLocator publicKeyLocator, CancellationToken cancellationToken = default(CancellationToken) ) : bool
dkimSignature Header The DKIM-Signature header.
publicKeyLocator IDkimPublicKeyLocator The public key locator service.
cancellationToken System.Threading.CancellationToken The cancellation token.
return bool

WriteTo() public method

Writes the message to the specified output stream.
Writes the message to the output stream using the provided formatting options.
/// is null. /// -or- /// is null. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. ///
public WriteTo ( MimeKit.FormatOptions options, Stream stream, CancellationToken cancellationToken = default(CancellationToken) ) : void
options MimeKit.FormatOptions The formatting options.
stream Stream The output stream.
cancellationToken System.Threading.CancellationToken A cancellation token.
return void

WriteTo() public method

Writes the message to the specified file.
Writes the message to the specified file using the provided formatting options.
/// is null. /// -or- /// is null. /// /// is a zero-length string, contains only white space, or /// contains one or more invalid characters as defined by /// . /// /// The operation was canceled via the cancellation token. /// /// is an invalid file path. /// /// The specified file path could not be found. /// /// The user does not have access to write to the specified file. /// /// An I/O error occurred. ///
public WriteTo ( MimeKit.FormatOptions options, string fileName, CancellationToken cancellationToken = default(CancellationToken) ) : void
options MimeKit.FormatOptions The formatting options.
fileName string The file.
cancellationToken System.Threading.CancellationToken A cancellation token.
return void

WriteTo() public method

Writes the message to the specified output stream.
Writes the message to the output stream using the default formatting options.
/// is null. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. ///
public WriteTo ( Stream stream, CancellationToken cancellationToken = default(CancellationToken) ) : void
stream Stream The output stream.
cancellationToken System.Threading.CancellationToken A cancellation token.
return void

WriteTo() public method

Writes the message to the specified file.
Writes the message to the specified file using the default formatting options.
/// is null. /// /// is a zero-length string, contains only white space, or /// contains one or more invalid characters as defined by /// . /// /// The operation was canceled via the cancellation token. /// /// is an invalid file path. /// /// The specified file path could not be found. /// /// The user does not have access to write to the specified file. /// /// An I/O error occurred. ///
public WriteTo ( string fileName, CancellationToken cancellationToken = default(CancellationToken) ) : void
fileName string The file.
cancellationToken System.Threading.CancellationToken A cancellation token.
return void