Chilkat .NET
Components for Email, Zip Compression, Encryption, XML, S/MIME, and Character
Encoding Conversion
Represents a complete Email object.
![]() |
Properties | Description | ||
| Body | The body of the email.
|
|||
| Decrypted | True if the email arrived encrypted and was successfully decrypted.
Chilkat Email.NET automatically tries to decrypt encrypted messages.
|
|||
| EmailDate | The date and time in UTC/GMT standard. Use the LocalDate property to get the local date and time.
|
|||
| EncryptedBy | If the email was received encrypted, this contains the details of the certificate used for encryption.
|
|||
| FileDistList | Set this property to send an email to a list of recipients stored in a plain text file. The file format is simple: one recipient per line, no comments allowed, blank lines are ignored.
Setting this property is equivalent to adding a "CKX-FileDistList" header field to the email. Chilkat Mail treats header fields beginning with "CKX-" specially in that these fields are never transmitted with the email when sent. However, CKX fields are saved and restored when saving to XML or loading from XML (or MIME).
When sending an email containing a "CKX-FileDistList" header field, Chilkat Mail will read the distribution list file and send the email to each recipient. Emails can be sent individually, or with BCC, 100 recipients at a time. (see the MailMan.SendIndividual property).
|
|||
| FromAddress | The email address of the sender.
|
|||
| FromName | The name of the sender.
|
|||
| From | The combined name and email address of the sender, such as "John Smith"
|
|||
| HtmlCharset | The character encoding of the HTML
email body, such as utf-8, iso-8859-1, shift-jis, big5, etc. To convert the HTML
body to another character encoding, simply set this property to the name of a
different charset. If the conversion fails because characters in the HTML source
have no representation in the target encoding, then nothing will happen and the
HtmlCharset property will remain unchanged. The conversion not only converts the
HTML character data, but adds or changes the HTML meta tag that specifies the
charset within the HTML.
|
|||
| LastError | An XML-formatted string containing error information, if any, of the last method call.
|
|||
| LocalDate | The local date and time of when the email was sent or created.
|
|||
| Mailer | Identifies the email software that sent the email.
|
|||
| NumAlternatives | The number of alternative bodies present in the email. An email that is not "multipart/alternative" will return 0 alternatives. An email that is "multipart/alternative" will return a number greater than or equal to 1.
|
|||
| NumAttachments | The number of attachments contained in the email.
|
|||
| NumBcc | The number of blind carbon-copy email recipients.
|
|||
| NumCC | The number of carbon-copy email recipients.
|
|||
| NumRelatedItems | The number of related items present in this email. Related items are typically image files (JPEGs or GIFs) or style sheets (CSS files) that are included with HTML formatted messages with internal "CID" hyperlinks.
|
|||
| NumTo | The number of direct email recipients.
|
|||
| OutlookDistList | Set this property to send an email to an Outlook distribution list. The string format is to include the folder path and distribution list name such as "Personal Folders/Contacts/My List". Forward slashes should be used instead of backslashes.
Setting this property is equivalent to adding a "CKX-OutlookDistList" header field to the email. Chilkat Mail treats header fields beginning with "CKX-" specially in that these fields are never transmitted with the email when sent. However, CKX fields are saved and restored when saving to XML or loading from XML (or MIME).
When sending an email containing a "CKX-OutlookDistList" header field, Chilkat Mail will fetch the recipients from the Outlook distribution list and send the email to each recipient. Emails can be sent individually or with BCC, 100 recipients at a time. (see the MailMan.SendIndividual property).
|
|||
| PlainTextCharset | The character encoding of the
plain-text email body, such as utf-8, iso-8859-1, shift-jis, big5, etc. To
convert the plain-text body to another character encoding, simply set this
property to the name of a different charset. If the conversion fails because
characters in the source have no representation in the target encoding, then
nothing will happen and the PlainTextCharset property will remain unchanged.
|
|||
| RawHeader | The raw header containing all the email fields not explicitly represented by properties or methods. Only emails retrieved from a POP3 mailbox will have a non-empty raw header. (as opposed to emails constructed programmatically by setting properties and calling methods)
|
|||
| ReceivedEncrypted | True if this email was originally received with encryption.
|
|||
| ReceivedSigned | True if this email was originally received with a digital signature.
|
|||
| ReplyTo | The email address to be used when a recipient replies.
|
|||
| ReturnReceipt | Set to True if you want the email to request a return-receipt when received by the recipient.
|
|||
| SendEncrypted | Set to True if this email should be sent encrypted.
|
|||
| SendSigned | Set to True if this email should be sent with a digital signature.
|
|||
| SignaturesValid | True if the email was received with one or more digital signatures, and if all the signatures were validated indicating that the email was not altered.
|
|||
| SignedBy | If the email was received digitally signed, this property contains the details of the signer.
|
|||
| Size | The size in bytes of the email, including all parts and attachments.
|
|||
| Subject | The email subject.
|
|||
| Uidl | This is the unique ID assigned by the POP3 server. Emails can be retrieved or deleted from the POP3 server via the UIDL. The header field for this property is "X-UIDL".
|
![]() |
Methods | Description | ||
| AddBcc | Adds a recipient to the blind carbon-copy list. address is required, but name may be empty. Returns True if successful.
|
|||
| AddCC | Adds a recipient to the carbon-copy list. address is required, but name may be empty. Returns True if successful.
|
|||
| AddDataAttachment | Adds an attachment directly from data in memory to the email.
|
|||
| AddFileAttachment2 | Same as AddFileAttachment, but the content type can be explicitly specified.
|
|||
| AddFileAttachment | Adds a file as an attachment to the email. Returns the MIME content-type of the attachment, which is inferred based on the filename extension.
|
|||
| AddStringAttachment | Adds an attachment directly from a string in memory to the email.
|
|||
| AddHeaderField | Any standard or non-standard (custom) header field can be added to the email with this method. One interesting feature is that all header fields whose name begins with "CKX-" will not be included in the header when an email is sent. These fields will be included when saved to or loaded from XML. This makes it easy to include persistent meta-data with an email which your programs can use in any way it chooses.
|
|||
| AddHtmlAlternativeBody | Sets the HTML body of the email. Use this method if there will be multiple versions of the body, but in different formats, such as HTML and plain text. Otherwise, set the body by calling the SetHtmlBody method.
|
|||
| AddMultipleBcc | Adds multiple recipients to the blind carbon-copy list. The parameter is a string containing a comma separated list of full email addresses. Returns True if successful.
|
|||
| AddMultipleCC | Adds multiple recipients to the carbon-copy list. The parameter is a string containing a comma separated list of full email addresses. Returns True if successful.
|
|||
| AddMultipleTo | Adds multiple recipients to the "to" list. The parameter is a string containing a comma separated list of full email addresses. Returns True if successful.
|
|||
| AddPlainTextAlternativeBody | Sets the plain-text body of the email. Use this method if there will be multiple versions of the body, but in different formats, such as HTML and plain text. Otherwise, simply set the Body property.
|
|||
| AddRelatedData | Adds the memory data as a related item to the email and returns the Content-ID. Emails formatted in HTML can include images with this call and internally reference the image through a "cid" hyperlink. (Chilkat Email.NET fully supports the MHTML standard.)
|
|||
| AddRelatedFile | Adds the contents of a file to the email and returns the Content-ID. Emails formatted in HTML can include images with this call and internally reference the image through a "cid" hyperlink. (Chilkat Email.NET fully supports the MHTML standard.)
|
|||
| AddTo | Adds a recipient to the "to" list. address is required, but name may be empty. Returns True if successful. Emails that have no "To" recipients will be sent to
|
|||
| AesDecrypt | Decrypts and restores an email message that was previously encrypted using AesEncrypt. The password must match the password used for encryption.
|
|||
| AesEncrypt | Encrypts the email body, all alternative bodies, all message sub-parts and attachments using 128-bit AES (Rijndael, CBC mode) encryption. To decrypt, you must use the AesDecrypt method with the same password.
The AesEncrypt/Decrypt methods use symmetric password-based greatly simplify sending and receiving encrypted emails because certificates and public/private key issues do not have to be dealt with. However, the sending and receiving applications must both be using Chilkat Email .NET or ActiveX components.
|
|||
| BEncodeBytes | Takes a byte array of multibyte
(non-Unicode) data and returns a Unicode B-Encoded string.
|
|||
| BEncodeString | Takes a Unicode string, converts it to
the charset specified in the 2nd parameter, B-Encodes the converted multibyte
data, and returns the encoded Unicode string.
|
|||
| ClearBcc | Clears the list of blind carbon-copy recipients.
|
|||
| ClearCC | Clears the list of carbon-copy recipients.
|
|||
| ClearTo | Clears the list of "to" recipients.
|
|||
| Clone | Creates and returns an identical copy of the Email object.
|
|||
| CreateForward | Returns a copy of the Email object with the body and header fields changed so that the newly created email can be forwarded. After calling CreateForward, simply add new recipients to the created email, and call MailMan.SendEmail.
|
|||
| CreateReply | Returns a copy of the Email object with the body and header fields changed so that the newly created email can be sent as a reply. After calling CreateReply, simply prepend additional information to the body, and call MailMan.SendEmail.
|
|||
| DropAttachments | Removes all attachments from the email.
|
|||
| DropSingleAttachment | Drops a single attachment from the email. Returns True if successful.
|
|||
| EncodeHeader | This is a smart and powerful method. It
converts all the appropriate email header fields to the specified charset.
Fields that cannot be converted because there is no representation in the target
charset are left unchanged. This method will convert the From, To, CC, Subject,
and ReplyTo fields. For address fields such as To, CC, etc., the name part of
the address is Q (or B) encoded but the address part is not. A simple way of
converting an entire email to another charset is to call EncodeHeader to convert
the header fields, and then set the HtmlCharset and
PlainTextCharset properties to convert the email
bodies.
|
|||
| GenerateFilename | Generates a unique filename for this email. The filename will be different each time the method is called.
|
|||
| GetAlternativeBody | Returns the Nth alternative body. The NumAlternatives property tells the number of alternative bodies present. Use the GetHtmlBody and GetPlainTextBody methods to easily get the HTML or plain text alternative bodies.
|
|||
| GetAlternativeContentType | Returns the content type of the Nth alternative body. The NumAlternatives property tells the number of alternative bodies present.
|
|||
| GetAlternativeContentID | Retrieves the contentID of an alternative body.
|
|||
| GetAttachmentData | Retrieves an attachment's binary data for in-memory access.
|
|||
| GetAttachmentFilename | Retrieves an attachment's filename.
|
|||
| GetAttachmentStringCrLf | Retrieves an attachment's data as a String. All end-of-lines will be translated to CRLF sequences.
|
|||
| GetAttachmentString | Retrieves an attachment's data as a String. All CRLF sequences will be translated to single newline characters.
|
|||
| GetBcc | Returns a blind carbon-copy recipient's full email address.
|
|||
| GetCC | Returns a blind carbon-copy recipient's full email address.
|
|||
| GetEncryptCert | Returns the certificate that was previously set by SetEncryptCert.
|
|||
| GetEncryptedByCert | Returns the certificate associated with a received encrypted email.
|
|||
| GetFileContent | Reads a file and returns the contents as a String. This is here purely for convenience.
|
|||
| GetHeaderFieldName | Return the name of the Nth header field. The NumHeaderFields() method can be used to get the number of header fields. The GetHeaderField() method can be used to get the value of the field given the field name.
|
|||
| GetHeaderField | Returns the value of a header field.
|
|||
| GetHtmlBody | Returns the body having the "text/html" content type.
|
|||
| GetMbHeaderField | Returns a header field's data in a byte
array. If the field was Q or B encoded, this is automatically decoded, and the
raw bytes of the field are returned. Call GetHeaderField to retrieve the header field as a
Unicode string.
|
|||
| GetMbHtmlBody | Returns the HTML body converted to a
specified charset. If no HTML body exists, the returned byte array is empty. The
returned data will be such that not only is the character data converted (if
necessary) to the convertToCharset, but the HTML is edited to add or modify the
META tag that specifies the charset within the HTML.
|
|||
| GetMbPlainTextBody | Returns the plain-text body converted
to a specified charset. The return value is a byte array containing multibyte
character data.
|
|||
| GetMimeObject | Creates and returns a Mime object containing the contents of the email. This method is provided for those users that need full access to every aspect of the MIME message, such as manipulation of the message headers of attachments and related items contained within message subparts.
(The returned Mime object returned is locked, and needs to be unlocked with a Chilkat S/MIME .NET unlock code, which can be obtained by purchasing a Chilkat S/MIME .NET license.)
|
|||
| GetMime | Return the email as MIME text containing the email header, body (or bodies), related items (if any), and all attachments
|
|||
| GetPlainTextBody | Returns the email body having the "text/plain" content type.
|
|||
| GetRelatedContentID | Returns the content ID of a related item contained with the email. Related items are typically images and style-sheets embedded within HTML emails.
|
|||
| GetRelatedData | Returns the content ID of a related item contained with the email. Related items are typically images and style-sheets embedded within HTML emails.
|
|||
| GetRelatedFilename | Returns the filename of a related item contained with the email. Related items are typically images and style-sheets embedded within HTML emails.
|
|||
| GetRelatedStringCrLf | Returns the text with CRLF line-endings of a related item contained with the email. Related items are typically images and style-sheets embedded within HTML emails.
|
|||
| GetRelatedString | Returns the text with CR line-endings of a related item contained with the email. Related items are typically images and style-sheets embedded within HTML emails.
|
|||
| GetReplacePattern | Returns a replacement pattern previously defined for mail-merge operations.
|
|||
| GetReplaceString2 | Returns a replacement string for a previously defined pattern/replacement string pair. (This is a mail-merge feature.)
|
|||
| GetReplaceString | Returns a replacement string for a previously defined pattern/replacement string pair. (This is a mail-merge feature.)
|
|||
| GetSignedByCert | Return the certificate used to digitally sign this email.
|
|||
| GetSigningCert | Return the certificate that will be used to digitally sign this email. This is the cerficate that was previously set by calling the SetSigningCert method.
|
|||
| GetTo | Returns a "to" recipient's full email address.
|
|||
| GetXml | Convert the email object to an XML document in memory
|
|||
| NumHeaderFields | Return the number of email header fields
|
|||
| QEncodeBytes | Takes a byte array of multibyte
(non-Unicode) data and returns a Unicode Q-Encoded string.
|
|||
| QEncodeString | Takes a Unicode string, converts it to
the charset specified in the 2nd parameter, Q-Encodes the converted multibyte
data, and returns the encoded Unicode string.
|
|||
| SaveAllAttachments | Save all the attachments of an email to a file
|
|||
| SaveAttachedFile | Save a specific email attachment to a file
|
|||
| SaveEml | Convert this email object to EML and save it to a file.
|
|||
| SaveLastError | Save the error log to an XML formatted file.
|
|||
| SaveRelatedItem | Save a related item to a file. Related content items are typically image or style-sheets embedded within an HTML email.
|
|||
| SaveXml | Convert this email object to XML and save it to a file.
|
|||
| SetAttachmentFilename | Set the filename attribute for an email attachment.
|
|||
| SetCSP | Set the Cryptographic Service Provider (CSP) to be used for encryption or digital signing this email.
You do not usually need to call this because the default is usually appropriate. One example of where this might be used is for applications using Smart Cards
that need to use the CSP of a Smart Card vendor.
|
|||
| SetEncryptCert | Set the encryption certificate to be used in encryption. Use the CreateCS, CertStore, and Cert classes to create a Cert object by either locating
a certificate in a certificate store or loading one from a file.
|
|||
| SetFromMimeObject | Loads and replaces the contents of this email object with the contents of a Mime object
|
|||
| SetFromMimeText | Replace the contents of this email object with that found in the MIME text
|
|||
| SetHtmlBody | Sets the HTML body of an email.
|
|||
| SetMbHtmlBody | Sets the HTML email body from a byte
array containing character data in the specified character set. This method also
updates the email "content-type" header to properly reflect the content type of
the body.
|
|||
| SetMbPlainTextBody | Sets the plain-text email body from a
byte array containing character data in the specified character set. This method
also updates the email "content-type" header to properly reflect the content
type of the body.
|
|||
| SetReplacePattern | Create a pattern/replacement-text pair for mail-merge
|
|||
| SetSigningCert | Set the certificate to be used in creating a digital signature. Use the CreateCS, CertStore, and Cert classes to create a Cert object by either locating
a certificate in a certificate store or loading one from a file.
|
|||
| UnlockComponent | Added as a convenience so that Chilkat Email.NET can be unlocked without necessarily having to create a
MailMan object and calling MailMan.UnlockComponent. Either one of
MailMan.UnlockComponent or Email.UnlockComponent can be called
once at the beginning of your program to unlock the entire Chilkat Email.NET component.
|
|||
| UnzipAttachments | Unzips and replaces any Zip file attachments with the expanded contents. As an example, if an email contained a single Zip file containing 3 GIF image files as an attachment, then after calling this method the email would contain 3 GIF file attachments, and the Zip attachment would be gone.
If an email contains multiple Zip file attachments, each Zip is expanded and replaced with the contents.
|
|||
| ZipAttachments | Replaces all the attachments of an email with a single Zip file attachment having the filename specified.
|
Copyright 2002, Chilkat Software, Inc. All Rights Reserved.