.NET Components
Chilkat .NET Components for Email, Zip Compression, Encryption, XML, S/MIME, and Character Encoding Conversion

BACK

Chilkat::Mime Class

Chilkat S/MIME allows you to easily create and manipulate MIME and S/MIME messages from within your .NET C#, ASP.NET, and VB.NET applications.

Base Classes: Object
  Properties Description  
    Boundary The boundary string to be used if this is a multipart message. By default, the boundary is automatically generated to be a unique and random string, so explicitly setting the boundary is not necessary.

 
    Charset The charset, such as "ISO-8859-1" or "utf-8"

 
    ContentType The MIME content type, such as "text/plain", "text/html", "multipart/alternative", "multipart/mixed", etc.

 
    Disposition The content disposition, which can be "attachment", "inline", etc.

 
    Encoding A content encoding such as "base64", "quoted-printable", "7bit", "8bit", etc.

 
    Filename The filename when the content disposition is "attachment".

 
    Micalg The MIC algorithm, such as "SHA1" when the content type is multipart/signed. Properties such as this are rarely set manually, as Chilkat MIME automatically sets it to the correct value when creating a signed message.

 
    NumParts The number of sub-parts contained within this message. Each sub-part is a complete Chilkat MIME message itself.

 
    Protocol A protocol such as "application/x-pkcs7-signature". Properties such as this are rarely set manually, as Chilkat MIME automatically sets it to the correct value when creating a signed message.

 
    UnwrapExtras Controls whether extra (informative) header fields are added to the MIME message when unwrapping security.

 
    Version The version, such as "1.0.0".

 
  Methods Description  
    AddDetachedSignature Signs the message using the certificate provided. If successful, the message is converted to "multipart/signed" and the original message will be contained in the first sub-part.

 
    AppendPart Appends a MIME message to the sub-parts of this message. Arbitrarily complex messages with unlimited nesting levels can be created. If the calling Mime object is not already multipart, it is automatically converted to multipart/mixed first.

 
    AppendPartFromFile Loads a file and creates a Mime message object using the file extension to determine the content type, and adds it as a sub-part to the calling object.

 
    ConvertToSigned Digitally signs the calling Mime object, but rather than the signature becoming a sub-part of the message (as in AddDetachedSignature) it becomes part of the message. In S/MIME terms, the message becomes application/x-pkcs7-mime rather than multipart/signed.

 
    Encrypt Encrypt a MIME message object using a digital certificate.

 
    GetBodyBinary Returns the body of the MIME message as a block of binary data. The body is automatically converted from its encoding type, such as base64 or quoted-printable, before being returned.

 
    GetBodyDecoded Returns the body of the MIME message as a string. The body is automatically converted from its encoding type, such as base64 or quoted-printable, before being returned.

 
    GetBodyEncoded Returns the body of the MIME message as a String. The body is explicitly not decoded from it's encoding type, so if it was represented in Base64, you will get the Base64 encoded body, as an example.

 
    GetEncryptCert Returns the Nth certificate used for encryption. Most likely the message was only encrypted once, and if so, the index should be set to 0.

 
    GetHeaderField Returns the content of a MIME header field. The "fieldName" is case-insensitive, and if the MIME header field does not exist, an empty string is returned.

 
    GetMime Returns a string containing the complete MIME message, including all sub-parts.

 
    GetPart Returns the Nth sub-part of the MIME message. Indexing begins at 0.

 
    GetSignerCert Returns the Nth digital certificate used to sign the MIME message. Indexing begins at 0.

 
    GetXml Converts the MIME (or S/MIME) message to XML and returns the XML as a string.

 
    IsApplicationData Return true if the MIME message contains application data, otherwise returns false.

 
    IsAttachment Return true if this MIME message is an attachment, otherwise returns false

 
    IsAudio Return true if the MIME message contains audio data, otherwise returns false.

 
    IsHtml Return true if the MIME body is HTML

 
    IsImage Return true if the MIME message contains image data, otherwise returns false.

 
    IsMultipart Return true if the MIME message is multipart (multipart/mixed, multipart/related, multipart/alternative, etc.), otherwise returns false.

 
    IsMultipartAlternative Return true if the MIME message is multipart/alternative, otherwise returns false.

 
    IsMultipartMixed Return true if the MIME message is multipart/mixed, otherwise returns false.

 
    IsMultipartRelated Return true if the MIME message is multipart/related, otherwise returns false.

 
    IsPlainText Return true if the MIME message body is plain text, otherwise returns false.

 
    IsSigned Return true if the MIME message is digitally signed, otherwise returns false.

 
    IsText Return true if the MIME message body is any text content type, such as text/plain, text/html, text/xml, etc., otherwise returns false.

 
    IsVideo Return true if the MIME message contains video data, otherwise returns false.

 
    IsXml Return true if the MIME message body is XML, otherwise returns false.

 
    LoadMime Discards the current contents of the MIME object and loads a new MIME message from a string.

 
    LoadMimeFile Discards the current contents of the MIME object and loads a new MIME message from a file.

 
    LoadXml Converts XML to MIME and replaces the MIME object's contents with the converted XML.

 
    LoadXmlFile Converts XML to MIME and replaces the MIME object's contents with the converted XML.

 
    NewMultipartAlternative Discards the current MIME message contents, if any, an initializes the MIME object to be an empty mulipart/alternative message.

 
    NewMultipartMixed Discards the current MIME message contents, if any, an initializes the MIME object to be an empty mulipart/mixed message.

 
    NewMultipartRelated Discards the current MIME message contents, if any, an initializes the MIME object to be an empty mulipart/related message.

 
    SetCSP Sets the encryption and digital signature preferences for this message. The CSP object will control the Cryptographic Service Provider used, the key container within the CSP to be used, and the encryption/hash algorithms.

 
    SaveBody Saves the MIME message body to a file. If the body is base64 or quoted-printable encoded, it is automatically decoded.

 
    SaveMime Saves the MIME message to a file, in MIME format. (This is the same as the .EML format used by Microsoft Outlook Express.)

 
    SaveXml Converts the MIME message to XML and saves to an XML file.

 
    SetBodyFromEncoded Sets the MIME message body from a Base64 or Quoted-Printable encoded string.

 
    SetBodyFromFile Sets the MIME message body from the contents of a file.

 
    SetBodyFromHtml Sets the MIME message body from a string containing HTML, and also updates the content-type to be text/html

 
    SetBodyFromPlainText Sets the MIME message body from a string containing plain text, and also updates the content-type to be text/plain

 
    SetBodyFromXml Sets the MIME message body from a string containing XML, and also updates the content-type to be text/xml

 
    SetHeaderField Adds or replaces a MIME message header field. If the field already exists, it is automatically replaced. Otherwise it is added.

 
    UnlockComponent Unlocks the component allowing for the full functionality to be used. Returns true if the unlock code is valid.

 
    UnwrapSecurity Decrypts and verifies all digital signatures contained within the MIME message, and returns true if all decryptions and verifications succeeded. Otherwise returns false. After unwrapping, the information regarding security and certificates can be obtained by the methods GetSignerCert and GetEncryptCert, and the properties NumEncryptCerts and NumSignerCerts.

 

Copyright 2002, Chilkat Software, Inc. All Rights Reserved.