|
Properties
Body As String
The body of the email. If the email has both HTML and plain-text bodies, this property returns the HTML body. The GetHtmlBody and GetPlainTextBody methods can be used to access a specific body. The HasHtmlBody and HasPlainTextBody methods can be used to determine the presence of a body.
BounceAddress As String
The "return-path" address of the email. Bounces will go to this address.
Charset As String
Sets the charset for the entire email. The header fields and plain-text/HTML bodies will be converted and sent in this charset. (This includes parsing and updating the HTML with the appropriate META tag specifying the charset.) All formatting and encoding of the email MIME is handled automatically by the Chilkat Mail component. If your application wants to send a Shift_JIS email, you simply set the Charset property to "Shift_JIS". Note: If a charset property is not explicitly set, the Chilkat component automatically detects the charset and chooses the appropriate charset. If all characters are 7bit (i.e. us-ascii) the charset is left blank. If the email contain a mix of languages such that no one charset can be chosen, or if the language cannot be determined without ambiguity, then the "utf-8" charset will be chosen.
Decrypted As Long (read-only)
True if the email arrived encrypted and was successfully decrypted. Chilkat Email.NET automatically tries to decrypt encrypted messages.
EmailDate As Date (read-only)
The date and time in UTC/GMT standard. Use the LocalDate property to get the local date and time.
EncryptedBy As String (read-only)
If the email was received encrypted, this contains the details of the certificate used for encryption.
FileDistList As String
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).
From As String
The combined name and email address of the sender, such as "John Smith"
FromAddress As String
The email address of the sender.
FromName As String
The name of the sender.
Header As String (read-only)
The complete MIME header of the email.
LastErrorHtml As String (read-only)
Error information in HTML format for the last method called.
LastErrorText As String (read-only)
Error information in plain-text format for the last method called.
LastErrorXml As String (read-only)
Error information in XML format for the last method called.
LocalDate As Date (read-only)
The local date and time of when the email was sent or created.
Mailer As String
Identifies the email software that sent the email.
NumAlternatives As Long (read-only)
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.
NumAttachedMessages As Long (read-only)
Returns the number of embedded emails. Some mail clients will embed an email that is to be forwarded into a new email as a "message/rfc822" subpart of the MIME message structure. This property tells how many emails have been embedded. The original email can be retrieved by calling GetAttachedMessage.
NumAttachments As Long (read-only)
The number of attachments contained in the email.
NumBcc As Long (read-only)
The number of blind carbon-copy email recipients.
NumCC As Long (read-only)
The number of carbon-copy email recipients.
NumHeaderFields As Long (read-only)
The number of header fields.
NumRelatedItems As Long (read-only)
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.
NumReplacePatterns As Long (read-only)
Returns the number of replacement patterns previously set by calling the SetReplacePattern method 1 or more times. If replacement patterns are set, the email bodies and header fields are modified by applying the search/replacement strings during the message sending process.
NumTo As Long (read-only)
The number of direct email recipients.
OverwriteExisting As Long
When true (the default) the methods to save email attachments will overwrite files if they already exist. If false, then the methods that save email attachments will append a string of 4 characters to create a unique filename if a file already exists. The filename of the attachment within the email object is updated and can be retrieved by the program to determine the actual file(s) created.
ReceivedEncrypted As Long (read-only)
True if this email was originally received with encryption.
ReceivedSigned As Long (read-only)
True if this email was originally received with a digital signature.
ReplyTo As String
The email address to be used when a recipient replies.
ReturnReceipt As Long
Set to True if you want the email to request a return-receipt when received by the recipient.
SendEncrypted As Long
Set to True if this email should be sent encrypted.
SendSigned As Long
Set to True if this email should be sent with a digital signature.
SignaturesValid As Long (read-only)
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 As String (read-only)
If the email was received digitally signed, this property contains the details of the signer.
Size As Long (read-only)
The size in bytes of the email, including all parts and attachments.
Subject As String
The email subject.
Uidl As String (read-only)
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
AddBcc(friendlyName As String, emailAddress As String) As Long
Adds a recipient to the blind carbon-copy list. address is required, but name may be empty. Returns True if successful.
AddCC(friendlyName As String, emailAddress As String) As Long
Adds a recipient to the carbon-copy list. address is required, but name may be empty. Returns True if successful.
AddDataAttachment(data As Variant, filename As String) As String
Adds an attachment directly from data in memory to the email.
AddFileAttachment(fileName As String) As String
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.
AddFileAttachment2(fileName As String, contentType As String, out As [, success As retval ] long *)
Same as AddFileAttachment, but the content type can be explicitly specified.
AddHeaderField(fieldName As String, fieldValue As String)
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(body As String)
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(commaSeparatedAddresses As String) As Long
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(commaSeparatedAddresses As String) As Long
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(commaSeparatedAddresses As String) As Long
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(body As String)
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(data As Variant, fileName As String) As String
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(fileName As String) As String
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.)
AddStringAttachment(filename As String, strData As String)
Adds an attachment directly from a string in memory to the email.
AddStringAttachment2(filename As String, strData As String, charset As String)
Adds an attachment to an email. The filename argument specifies the filename to be used for the attachment and is not an actual filename existing on the local filesystem. The "str" argument contains the text data for the attachment. The string will be converted to the charset specified in the last argument before being added to the email.
AddTo(friendlyName As String, emailAddress As String) As Long
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(password As String)
Decrypts and restores an email message that was previously encrypted using AesEncrypt. The password must match the password used for encryption.
AesEncrypt(password As String)
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.
AppendToBody(str As String)
Appends a string to the plain-text body.
BEncodeBytes(mbBytes As Variant, charset As String) As String
Takes a byte array of multibyte (non-Unicode) data and returns a Unicode B-Encoded string.
BEncodeString(str As String, charset As String) As String
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() As WebEmail2
Creates and returns an identical copy of the Email object.
CreateForward() As WebEmail2
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() As WebEmail2
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.
CreateTempMht(inFilename As String) As String
Saves the email to a temporary MHT file so that a WebBrowser control can navigate to it and display it. If fileName is empty, a temporary filename is generated and returned. If fileName is non-empty, then it will be created or overwritten, and the input filename is simply returned.The MHT file that is created will not contain any of the email's attachments, if any existed. Also, if the email was plain-text, the MHT file will be saved such that the plain-text is converted to HTML using pre-formatted text ( HTML tags) allowing it to be displayed correctly in a WebBrowser.
DropAttachments()
Removes all attachments from the email.
DropRelatedItem(idx As Long)
A related item is typically an embedded image referenced from the HTML in the email via a "CID" hyperlink. This method removes the Nth embedded image from the email. Note: If the HTML tries to reference the removed image, it will be displayed as a broken image link.
DropRelatedItems()
A related item is typically an embedded image referenced from the HTML in the email via a "CID" hyperlink. This method removes all the embedded images from the email.
DropSingleAttachment(index As Long) As Long
Drops a single attachment from the email. Returns True if successful.
GetAlternativeBody(index As Long) As String
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(index As Long) As String
Returns the content type of the Nth alternative body. The NumAlternatives property tells the number of alternative bodies present.
GetAttachedMessage(index As Long) As WebEmail2
Returns an embedded "message/rfc822" subpart as an email object. (Emails are embedded as "message/rfc822" subparts by some mail clients when forwarding an email.) This method allows the original email to be accessed.
GetAttachmentContentID(index As Long) As String
Returns the ContentID header field for the Nth attachment. The first attachment is at index 0.
GetAttachmentContentType(index As Long) As String
Returns the Content-Type header field for the Nth attachment. Indexing of attachments begins at 0.
GetAttachmentData(index As Long) As Variant
Retrieves an attachment's binary data for in-memory access.
GetAttachmentFilename(index As Long) As String
Retrieves an attachment's filename.
GetAttachmentSize(index As Long) As Long
Returns the size (in bytes) of the Nth attachment.
GetAttachmentString(index As Long, charset As String) As String
Retrieves an attachment's data as a String. All CRLF sequences will be translated to single newline characters.
GetAttachmentStringCrLf(index As Long, srcCharset As String) As String
Retrieves an attachment's data as a String. All end-of-lines will be translated to CRLF sequences.
GetBcc(index As Long) As String
Returns a blind carbon-copy recipient's full email address.
GetBccAddr(index As Long) As String
Returns the Nth BCC address (only the address part, not the friendly-name part).
GetBccName(index As Long) As String
Returns the Nth BCC name (only the friendly-name part, not the address part).
GetCC(index As Long) As String
Returns a carbon-copy recipient's full email address.
GetCcAddr(index As Long) As String
Returns the Nth CC address (only the address part, not the friendly-name part).
GetCcName(index As Long) As String
Returns the Nth CC name (only the friendly-name part, not the address part).
GetEncryptCert() As ChilkatCert
Returns the certificate that was previously set by SetEncryptCert.
GetEncryptedByCert() As ChilkatCert
Returns the certificate associated with a received encrypted email.
GetHeaderField(fieldName As String) As String
Returns the value of a header field.
GetHeaderFieldName(index As Long) As String
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.
GetHeaderFieldValue(index As Long) As String
Returns the value of the Nth header field. (Indexing begins at 0) The number of header fields can be obtained from the NumHeaderFields property.
GetHtmlBody() As String
Returns the body having the "text/html" content type.
GetLinkedDomains() As CkStringArray
Parses an HTML email and returns the set of domain names that occur in hyperlinks within the HTML body.
GetMbHeaderField(fieldName As String, charset As String) As Variant
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(convertToCharset As String) As Variant
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(convertToCharset As String) As Variant
Returns the plain-text body converted to a specified charset. The return value is a byte array containing multibyte character data.
GetMime() As String
Return the email as MIME text containing the email header, body (or bodies), related items (if any), and all attachments
GetMimeObject() As ChilkatMime
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.)
GetPlainTextBody() As String
Returns the email body having the "text/plain" content type.
GetRelatedContentID(index As Long) As String
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(index As Long) As Variant
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(index As Long) As String
Returns the filename of a related item contained with the email. Related items are typically images and style-sheets embedded within HTML emails.
GetRelatedString(index As Long, srcCharset As String) As String
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.
GetRelatedStringCrLf(index As Long, srcCharset As String) As String
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.
GetReplacePattern(index As Long) As String
Returns a replacement pattern previously defined for mail-merge operations.
GetReplaceString(index As Long) As String
Returns a replacement string for a previously defined pattern/replacement string pair. (This is a mail-merge feature.)
GetReplaceString2(pattern As String) As String
Returns a replacement string for a previously defined pattern/replacement string pair. (This is a mail-merge feature.)
GetSignedByCert() As ChilkatCert
Return the certificate used to digitally sign this email.
GetSigningCert() As ChilkatCert
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(index As Long) As String
Returns a "to" recipient's full email address.
GetToAddr(index As Long) As String
Returns the Nth To address (only the address part, not the friendly-name part).
GetToName(index As Long) As String
Returns the Nth To name (only the friendly-name part, not the address part).
GetXml() As String
Convert the email object to an XML document in memory
HasHtmlBody() As Long
Returns true if the email has an HTML body.
HasPlainTextBody() As Long
Returns true if the email has a plain-text body.
IsMultipartReport() As Long
Returns true if the email is a multipart/report email.
LoadEml(emlFilename As String) As Long
Loads a complete email from a .EML file. (EML files are simply RFC822 MIME text files.)
LoadTextFileToUnicode(filename As String, srcCharset As String) As String
Loads a text file encoded in any charset and returns a Unicode string (Visual Basic strings are Unicode). The charset argument can be any of the following charsets:
us-ascii
unicode
unicodefffe
iso-8859-1
iso-8859-2
iso-8859-3
iso-8859-4
iso-8859-5
iso-8859-6
iso-8859-7
iso-8859-8
iso-8859-9
iso-8859-13
iso-8859-15
windows-874
windows-1250
windows-1251
windows-1252
windows-1253
windows-1254
windows-1255
windows-1256
windows-1257
windows-1258
utf-7
utf-8
utf-32
utf-32be
shift_jis
gb2312
ks_c_5601-1987
big5
iso-2022-jp
iso-2022-kr
euc-jp
euc-kr
macintosh
x-mac-japanese
x-mac-chinesetrad
x-mac-korean
x-mac-arabic
x-mac-hebrew
x-mac-greek
x-mac-cyrillic
x-mac-chinesesimp
x-mac-romanian
x-mac-ukrainian
x-mac-thai
x-mac-ce
x-mac-icelandic
x-mac-turkish
x-mac-croatian
asmo-708
dos-720
dos-862
ibm037
ibm437
ibm500
ibm737
ibm775
ibm850
ibm852
ibm855
ibm857
ibm00858
ibm860
ibm861
ibm863
ibm864
ibm865
cp866
ibm869
ibm870
cp875
koi8-r
koi8-u
LoadXml(xmlFilename As String) As Long
Loads an email with the contents of an XML email file.
LoadXmlString(xmlStr As String) As Long
Loads an email from an XML string (previously obtained by calling the GetXml method). The contents of the calling email object are erased and replaced with the email contained within the XML string.Returns 1 for success, 0 for failure.
QEncodeBytes(mbBytes As Variant, charset As String) As String
Takes a byte array of multibyte (non-Unicode) data and returns a Unicode Q-Encoded string.
QEncodeString(str As String, charset As String) As String
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.
RemoveHeaderField(fieldName As String)
Removes by name all occurances of a header field.
SaveAllAttachments(directory As String) As Long
Save all the attachments of an email to a file
SaveAttachedFile(index As Long, directory As String) As Long
Save a specific email attachment to a file
SaveEml(filename As String, out As [, success As retval ] long *)
Convert this email object to EML and save it to a file.
SaveLastError(filename As String, out As [, success As retval ] long *)
Saves the last error information to an XML formatted file.
SaveRelatedItem(index As Long, directory As String) As Long
Save a related item to a file. Related content items are typically image or style-sheets embedded within an HTML email.
SaveXml(filename As String) As Long
Convert this email object to XML and save it to a file.
SetAttachmentFilename(index As Long, filename As String) As Long
Set the filename attribute for an email attachment.
SetCSP(iCsp As ChilkatCSP)
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(iCert As ChilkatCert)
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(iMime As ChilkatMime)
Loads and replaces the contents of this email object with the contents of a Mime object
SetFromMimeText(mimeText As String)
Replace the contents of this email object with that found in the MIME text
SetFromXmlText(xmlText As String) As Long
Loads an email from an XML string.
SetHtmlBody(html As String)
Sets the HTML body of an email.
SetMbHtmlBody(charset As String, body As Variant)
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(charset As String, body As Variant)
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(pattern As String, replaceString As String) As Long
Create a pattern/replacement-text pair for mail-merge
SetSigningCert(iCert As ChilkatCert)
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.
UnzipAttachments() As Long
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(zipFilename As String)
Replaces all the attachments of an email with a single Zip file attachment having the filename specified.
|