Imap ActiveX Reference Documentation

Imap

IMAP email component.

Object Creation

(Visual Basic 6.0)
Dim obj As New ChilkatImap

(ASP)
set obj = Server.CreateObject("Chilkat_9_5_0.Imap")

(VBScript)
set obj = CreateObject("Chilkat_9_5_0.Imap")

(Delphi)
obj := TChilkatImap.Create(Self);

(FoxPro)
loObject = CreateObject('Chilkat_9_5_0.Imap')

(PowerBuilder)
lole_object = create oleobject
li_rc = lole_object.ConnectToNewObject("Chilkat_9_5_0.Imap")

(SQL Server)
EXEC @hr = sp_OACreate 'Chilkat_9_5_0.Imap', @obj OUT

(Javascript)
var obj = new ActiveXObject("Chilkat_9_5_0.Imap");

Properties

AbortCurrent As Long

Introduced in version 9.5.0.58

When set to 1, causes the currently running method to abort. Methods that always finish quickly (i.e.have no length file operations or network communications) are not affected. If no method is running, then this property is automatically reset to 0 when the next method is called. When the abort occurs, this property is reset to 0. Both synchronous and asynchronous method calls can be aborted. (A synchronous method call could be aborted by setting this property from a separate thread.)

AppendSeen As Long

When 1 (the default) the Append method will mark the email appended to a mailbox as already seen. Otherwise an appended email will be initialized to have a status of unseen.

AppendUid As Long (read-only)

The UID of the last email appended to a mailbox via an Append* method. (Not all IMAP servers report back the UID of the email appended.)

(Classic ASP) Upload (Append) Email to an IMAP Mailbox and get the UID of the Appended Email

(Visual FoxPro) Upload (Append) Email to an IMAP Mailbox and get the UID of the Appended Email

(PowerBuilder) Upload (Append) Email to an IMAP Mailbox and get the UID of the Appended Email

(SQL Server) Upload (Append) Email to an IMAP Mailbox and get the UID of the Appended Email

(Visual Basic 6.0) Upload (Append) Email to an IMAP Mailbox and get the UID of the Appended Email

(VBScript) Upload (Append) Email to an IMAP Mailbox and get the UID of the Appended Email

AuthMethod As String

Can be set to "XOAUTH2", "CRAM-MD5", "NTLM", "PLAIN", or "LOGIN" to select the authentication method. NTLM is the most secure, and is a synonym for "Windows Integrated Authentication". The default is "LOGIN" (or the empty string) which is simple plain-text username/password authentication. Not all IMAP servers support all authentication methods.

The XOAUTH2 method was added in version 9.5.0.44.

Note: If SPA (i.e. NTLM) authentication does not succeed, set the Global.DefaultNtlmVersion property equal to 1 and then retry.

AuthzId As String

Applies to the PLAIN authentication method. May be set to an authorization ID that is to be sent along with the Login and Password for authentication.

AutoDownloadAttachments As Long

If set to 1, then all Fetch* methods will also automatically download attachments. If set to 0, then the Fetch* methods download the email without attachments. The default value is 1.

Note: Methods that download headers-only, such as FetchSingleHeader, ignore this property and never download attachments. Also, signed and/or encrypted emails will always be downloaded in full (with attachments) regardless of this property setting.

Fetching IMAP Attachments

Getting Attachment Information

Understanding IMAP Email Attachments

AutoFix As Long

If 1, then the following will occur when a connection is made to an IMAP server:

1) If the Port property = 993, then sets StartTls = 0 and Ssl = 1
2) If the Port property = 143, sets Ssl = 0

The default value of this property is 1.

ClientIpAddress As String

The IP address to use for computers with multiple network interfaces or IP addresses. For computers with a single network interface (i.e. most computers), this property should not be set. For multihoming computers, the default IP address is automatically used if this property is not set.

The IP address is a string such as in dotted notation using numbers, not domain names, such as "165.164.55.124".

Important Bind to Adapter Notes for Windows

ConnectedToHost As String (read-only)

Contains the IMAP server's domain name (or IP address) if currently connected. Otherwise returns an empty string.

ConnectTimeout As Long

Maximum number of seconds to wait when connecting to an IMAP server. The default value is 30 (units are in seconds).

DebugLogFilePath As String

If set to a file path, causes each Chilkat method or property call to automatically append it's LastErrorText to the specified log file. The information is appended such that if a hang or crash occurs, it is possible to see the context in which the problem occurred, as well as a history of all Chilkat calls up to the point of the problem. The VerboseLogging property can be set to provide more detailed information.

This property is typically used for debugging the rare cases where a Chilkat method call hangs or generates an exception that halts program execution (i.e. crashes). A hang or crash should generally never happen. The typical causes of a hang are:

  1. a timeout related property was set to 0 to explicitly indicate that an infinite timeout is desired,
  2. the hang is actually a hang within an event callback (i.e. it is a hang within the application code), or
  3. there is an internal problem (bug) in the Chilkat code that causes the hang.

Domain As String

The Windows Domain to use for Windows Integrated Authentication (also known as NTLM). This may be empty.

HeartbeatMs As Long

This is the number of milliseconds between each AbortCheck event callback. The AbortCheck callback allows an application to abort any IMAP operation prior to completion. If HeartbeatMs is 0, no AbortCheck event callbacks will occur.

HttpProxyAuthMethod As String

If an HTTP proxy requiring authentication is to be used, set this property to the HTTP proxy authentication method name. Valid choices are "Basic" or "NTLM".

HttpProxyDomain As String

The NTLM authentication domain (optional) if NTLM authentication is used.

HttpProxyHostname As String

If an HTTP proxy is to be used, set this property to the HTTP proxy hostname or IPv4 address (in dotted decimal notation).

HttpProxyPassword As String

If an HTTP proxy requiring authentication is to be used, set this property to the HTTP proxy password.

HttpProxyPort As Long

If an HTTP proxy is to be used, set this property to the HTTP proxy port number. (Two commonly used HTTP proxy ports are 8080 and 3128.)

HttpProxyUsername As String

If an HTTP proxy requiring authentication is to be used, set this property to the HTTP proxy login name.

KeepSessionLog As Long

Turns the in-memory session logging on or off. If on, the session log can be obtained via the SessionLog property. The default value is 0.

The SessionLog contains the raw commands sent to the IMAP server, and the raw responses received from the IMAP server.

LastAppendedMime As String (read-only)

The MIME source of the email last appended during a call to AppendMail, or AppendMime.

LastBinaryResult As Variant (read-only)

Introduced in version 9.5.0.52

The binary data returned by the last (binary data returning) method called. Only available if Chilkat.Global.KeepBinaryResult is set to 1. This provides a means for obtaining large varbinary results in the SQL Server environment (where limitations exist in getting large amounts of data returned by method calls, but where temp tables can be used for binary properties).

LastCommand As String (read-only)

The last raw command sent to the IMAP server. (This information can be used for debugging if problems occur.)

LastErrorHtml As String (read-only)

Provides information in HTML format about the last method/property called. If a method call returns a value indicating failure, or behaves unexpectedly, examine this property to get more information.

LastErrorText As String (read-only)

Provides information in plain-text format about the last method/property called. If a method call returns a value indicating failure, or behaves unexpectedly, examine this property to get more information.

Concept of LastErrorText

LastErrorText Standard Information

LastErrorXml As String (read-only)

Provides information in XML format about the last method/property called. If a method call returns a value indicating failure, or behaves unexpectedly, examine this property to get more information.

LastIntermediateResponse As String (read-only)

The last intermediate response received from the IMAP server. (This information can be used for debugging if problems occur.)

LastMethodSuccess As Long

Introduced in version 9.5.0.52

Indicate whether the last method call succeeded or failed. A value of 1 indicates success, a value of 0 indicates failure. This property is automatically set for method calls. It is not modified by property accesses. The property is automatically set to indicate success for the following types of method calls:

  • Any method that returns a string.
  • Any method returning a Chilkat object, binary bytes, or a date/time.
  • Any method returning a standard boolean status value where success = 1 and failure = 0.
  • Any method returning an integer where failure is defined by a return value less than zero.

Note: Methods that do not fit the above requirements will always set this property equal to 1. For example, a method that returns no value (such as a "void" in C++) will technically always succeed.

LastResponse As String (read-only)

The raw data of the last response from the IMAP server. (Useful for debugging if problems occur.) This property is cleared whenever a command is sent to the IMAP server. If no response is received, then this property will remain empty. Otherwise, it will contain the last response received from the IMAP server.

LastResponseCode As String (read-only)

Introduced in version 9.5.0.44

The response code part of the last command response, if it exists. IMAP status responses MAY include an OPTIONAL "response code". A response code consists of data inside square brackets in the form of an atom, possibly followed by a space and arguments. The response code contains additional information or status codes for client software beyond the OK/NO/BAD condition, and are defined when there is a specific action that a client can take based upon the additional information. Examples of response codes are "NONEXISTENT" and "AUTHENTICATIONFAILED". The response code strings for a given failure condition may vary depending on the IMAP server implementation.

LastStringResult As String (read-only)

Introduced in version 9.5.0.52

The string return value of the last (string returning) method called. Only available if Chilkat.Global.KeepStringResult is set to 1. This provides a means for obtaining large string results in the SQL Server environment (where limitations exist in getting long strings returned by method calls, but where temp tables can be used for string properties).

Long Strings Returned by ActiveX Methods in SQL Server

LastStringResultLen As Long (read-only)

Introduced in version 9.5.0.53

The length, in characters, of the string contained in the LastStringResult property.

LoggedInUser As String (read-only)

If logged into an IMAP server, the logged-in username.

NumMessages As Long (read-only)

After selecting a mailbox (by calling SelectMailbox), this property will be updated to reflect the total number of emails in the mailbox.

PeekMode As Long

Set to true to prevent the mail flags (such as the "Seen" flag) from being set when email is retrieved. The default value of this property is false.

PercentDoneScale As Long

Introduced in version 9.5.0.49

This property is only valid in programming environment and languages that allow for event callbacks.

Sets the value to be defined as 100% complete for the purpose of PercentDone event callbacks. The defaut value of 100 means that at most 100 event PercentDone callbacks will occur in a method that (1) is event enabled and (2) is such that it is possible to measure progress as a percentage completed. This property may be set to larger numbers to get more fine-grained PercentDone callbacks. For example, setting this property equal to 1000 will provide callbacks with .1 percent granularity. For example, a value of 453 would indicate 45.3% competed. This property is clamped to a minimum value of 10, and a maximum value of 100000.

Port As Long

The IMAP port number. If using SSL, be sure to set this to the IMAP SSL port number, which is typically port 993. (If this is the case, make sure you also set the Ssl property = 1.

PreferIpv6 As Long

If 1, then use IPv6 over IPv4 when both are supported for a particular domain. The default value of this property is 0, which will choose IPv4 over IPv6.

ReadTimeout As Long

The maximum amount of time (in seconds) that incoming data is allowed to stall while reading any kind of response from an IMAP server. This is the amount of time that needs to elapse while no additional response bytes are forthcoming. For the case of long responses, if the data stream halts for more than this amount, it will timeout. This property is not a maximum for the total response time, but only a maximum for the amount of time while no response arrives.

The default value is 30 seconds.

RequireSslCertVerify As Long

If 1, then the IMAP client will verify the server's SSL certificate. The certificate is expired, or if the cert's signature is invalid, the connection is not allowed. The default value of this property is 0.

SearchCharset As String

The "CHARSET" to be used in searches issued by the Search method. The default value is "UTF-8". (If no 8bit chars are found in the search criteria passed to the Search method, then no CHARSET is needed and this property doesn't apply.) The SearchCharset property can be set to "AUTO" to get the pre-v9.4.0 behavior, which is to examine the 8bit chars found in the search criteria and select an appropriate multibyte charset.

In summary, it is unlikely that this property needs to be changed. It should only be modified if trouble arises with some IMAP servers when non-English chars are used in the search criteria.

SelectedMailbox As String (read-only)

The currently selected mailbox, or an empty string if none.

SendBufferSize As Long

The buffer size to be used with the underlying TCP/IP socket for sending. The default value is 32767.

SeparatorChar As String

The separator character used by the IMAP server for the mailbox hierarchy. It is typically "/" or ".", but may vary depending on the IMAP server. The ListMailboxes method has the side-effect of setting this property to the correct value because the IMAP server's response when listing mailboxes includes information about the separator char.

Note: Starting in version 9.5.0.47, this property changed from a "char" type to a "string" type. The separator char property will always be a string of length 1 character.

SessionLog As String (read-only)

Contains an in-memory log of the raw commands sent to the IMAP server, and the raw responses received from the IMAP server. The KeepSessionLog property must be set to 1 to enable session logging. Call ClearSessionLog to reset the log.

SocksHostname As String

The SOCKS4/SOCKS5 hostname or IPv4 address (in dotted decimal notation). This property is only used if the SocksVersion property is set to 4 or 5).

SocksPassword As String

The SOCKS5 password (if required). The SOCKS4 protocol does not include the use of a password, so this does not apply to SOCKS4.

SocksPort As Long

The SOCKS4/SOCKS5 proxy port. The default value is 1080. This property only applies if a SOCKS proxy is used (if the SocksVersion property is set to 4 or 5).

SocksUsername As String

The SOCKS4/SOCKS5 proxy username. This property is only used if the SocksVersion property is set to 4 or 5).

SocksVersion As Long

SocksVersion May be set to one of the following integer values:

0 - No SOCKS proxy is used. This is the default.
4 - Connect via a SOCKS4 proxy.
5 - Connect via a SOCKS5 proxy.

SoRcvBuf As Long

Sets the receive buffer size socket option. Normally, this property should be left unchanged. The default value is 4194304.

This property can be increased if download performance seems slow. It is recommended to be a multiple of 4096.

More Information about TCP performance and Buffer Sizes

SoSndBuf As Long

Sets the send buffer size socket option. Normally, this property should be left unchanged. The default value is 262144.

This property can be increased if upload performance seems slow. It is recommended to be a multiple of 4096. Testing with sizes such as 512K and 1MB is reasonable.

More Information about TCP performance and Buffer Sizes

Ssl As Long

1 if the IMAP connection should be TLS/SSL.

Note: The typical IMAP TLS/SSL port number is 993. If you set this property = 1, it is likely that you should also set the Port property = 993.

SslAllowedCiphers As String

Introduced in version 9.5.0.48

Provides a means for setting a list of ciphers that are allowed for SSL/TLS connections. The default (empty string) indicates that all implemented ciphers are possible. The TLS ciphers supported in Chilkat v9.5.0.55 and later are:

TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
TLS_DHE_RSA_WITH_AES_256_CBC_SHA
TLS_RSA_WITH_AES_256_CBC_SHA256
TLS_RSA_WITH_AES_256_GCM_SHA384
TLS_RSA_WITH_AES_256_CBC_SHA
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
TLS_DHE_RSA_WITH_AES_128_CBC_SHA
TLS_RSA_WITH_AES_128_CBC_SHA256
TLS_RSA_WITH_AES_128_GCM_SHA256
TLS_RSA_WITH_AES_128_CBC_SHA
TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
TLS_RSA_WITH_3DES_EDE_CBC_SHA
TLS_ECDHE_RSA_WITH_RC4_128_SHA
TLS_RSA_WITH_RC4_128_SHA
TLS_RSA_WITH_RC4_128_MD5
TLS_DHE_RSA_WITH_DES_CBC_SHA
TLS_RSA_WITH_DES_CBC_SHA
To restrict SSL/TLS connections to one or more specific ciphers, set this property to a comma-separated list of ciphers such as "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384". The order should be in terms of preference, with the preferred algorithms listed first. (Note that the client cannot specifically choose the algorithm is picked because it is the server that chooses. The client simply provides the server with a list from which to choose.)

The property can also disallow connections with servers having certificates with RSA keys less than a certain size. By default, server certificates having RSA keys of 512 bits or greater are allowed. Add the keyword "rsa1024" to disallow connections with servers having keys smaller than 1024 bits. Add the keyword "rsa2048" to disallow connections with servers having keys smaller than 2048 bits.

Note: Prior to Chilkat v9.5.0.55, it was not possible to explicitly list allowed cipher suites. The deprecated means for indicating allowed ciphers was both incomplete and unprecise. For example, the following keywords could be listed to allow matching ciphers: "aes256-cbc", "aes128-cbc", "3des-cbc", and "rc4". These keywords will still be recognized, but programs should be updated to explicitly list the allowed ciphers.

secure-renegotiation: Starting in Chilkat v9.5.0.55, the keyword "secure-renegotiation" may be added to require that all renegotions be done securely (as per RFC 5746).

best-practices: Starting in Chilkat v9.5.0.55, this property may be set to the single keyword "best-practices". This will allow ciphers based on the current best practices. As new versions of Chilkat are released, the best practices may change. Changes will be noted here. The current best practices are:

  • If the server uses an RSA key, it must be 1024 bits or greater.
  • All renegotations must be secure renegotiations.
  • All ciphers using RC4, DES, or 3DES are disallowed.

Example: The following string would restrict to 2 specific cipher suites, require RSA keys to be 1024 bits or greater, and require secure renegotiations: "TLS_DHE_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, rsa1024, secure-renegotiation"

SslProtocol As String

Selects the secure protocol to be used for secure (SSL/TLS) connections. Possible values are:

default
TLS 1.2
TLS 1.1
TLS 1.0
SSL 3.0
TLS 1.2 or higher
TLS 1.1 or higher
TLS 1.0 or higher
The default value is "default" which will choose the, which allows for the protocol to be selected dynamically at runtime based on the requirements of the server. Choosing an exact protocol will cause the connection to fail unless that exact protocol is negotiated. It is better to choose "X or higher" than an exact protocol. The "default" is effectively "SSL 3.0 or higher".

SslServerCertVerified As Long (read-only)

Read-only property that returns 1 if the IMAP server's digital certificate was verified when connecting via SSL / TLS.

StartTls As Long

If 1, then the Connect method will (internallly) convert the connection to TLS/SSL via the STARTTLS IMAP command. This is called "explict SSL/TLS" because the client explicitly requests the connection be transformed into a TLS/SSL secure channel. The alternative is "implicit SSL/TLS" where the "Ssl" property is set to 1 and the IMAP client connects to the well-known TLS/SSL IMAP port of 993.

TlsCipherSuite As String (read-only)

Introduced in version 9.5.0.49

Contains the current or last negotiated TLS cipher suite. If no TLS connection has yet to be established, or if a connection as attempted and failed, then this will be empty. A sample cipher suite string looks like this: TLS_DHE_RSA_WITH_AES_256_CBC_SHA256.

TlsPinSet As String

Introduced in version 9.5.0.55

Specifies a set of pins for Public Key Pinning for TLS connections. This property lists the expected SPKI fingerprints for the server certificates. If the server's certificate (sent during the TLS handshake) does not match any of the SPKI fingerprints, then the TLS handshake is aborted and the connection fails. The format of this string property is as follows:

hash_algorithm, encoding, SPKI_fingerprint_1, SPKI_fingerprint_2, ...
For example, the following string specifies a single sha256 base64-encoded SPKI fingerprint:
"sha256, base64, lKg1SIqyhPSK19tlPbjl8s02yChsVTDklQpkMCHvsTE="
This example specifies two SPKI fingerprints:
"sha256, base64, 4t37LpnGmrMEAG8HEz9yIrnvJV2euVRwCLb9EH5WZyI=, 68b0G5iqMvWVWvUCjMuhLEyekM5729PadtnU5tdXZKs="
Any of the following hash algorithms are allowed:.sha1, sha256, sha384, sha512, md2, md5, haval, ripemd128, ripemd160,ripemd256, or ripemd320.

The following encodings are allowed: base64, hex, and any of the encodings indicated in the link below.

Encodings Supported by Chilkat

TlsVersion As String (read-only)

Introduced in version 9.5.0.49

Contains the current or last negotiated TLS protocol version. If no TLS connection has yet to be established, or if a connection as attempted and failed, then this will be empty. Possible values are "SSL 3.0", "TLS 1.0", "TLS 1.1", and "TLS 1.2".

UidNext As Long (read-only)

A positive integer value containing the UIDNEXT of the currently selected folder, or 0 if it's not available or no folder is selected.

(Classic ASP) Upload (Append) Email to an IMAP Mailbox and get the UID of the Appended Email

(Visual FoxPro) Upload (Append) Email to an IMAP Mailbox and get the UID of the Appended Email

(PowerBuilder) Upload (Append) Email to an IMAP Mailbox and get the UID of the Appended Email

(SQL Server) Upload (Append) Email to an IMAP Mailbox and get the UID of the Appended Email

(Visual Basic 6.0) Upload (Append) Email to an IMAP Mailbox and get the UID of the Appended Email

(VBScript) Upload (Append) Email to an IMAP Mailbox and get the UID of the Appended Email

UidValidity As Long (read-only)

An integer value containing the UIDVALIDITY of the currently selected mailbox, or 0 if no mailbox is selected.

A client can save the UidValidity value for a mailbox and then compare it with the UidValidity on a subsequent session. If the new value is larger, the IMAP server is not keeping UID's unchanged between sessions. Most IMAP servers maintain UID's between sessions.

VerboseLogging As Long

If set to 1, then the contents of LastErrorText (or LastErrorXml, or LastErrorHtml) may contain more verbose information. The default value is 0. Verbose logging should only be used for debugging. The potentially large quantity of logged information may adversely affect peformance.

Version As String (read-only)

Version of the component/library, such as "9.5.0.63"

Methods

AddPfxSourceData(pfxBytes As Variant, pfxPassword As String) As Long

Introduced in version 9.5.0.46

Returns 1 if the underlying TCP socket is connected to the IMAP server.

Returns 1 for success, 0 for failure.

AddPfxSourceFile(pfxFilePath As String, pfxPassword As String) As Long

Adds a PFX file to the object's internal list of sources to be searched for certificates and private keys when decrypting. Multiple PFX files can be added by calling this method once for each. (On the Windows operating system, the registry-based certificate stores are also automatically searched, so it is commonly not required to explicitly add PFX sources.)

The pfxFilePath contains the bytes of a PFX file (also known as PKCS12 or .p12).

Returns 1 for success, 0 for failure.

AppendMail(mailbox As String, email As ChilkatEmail) As Long

Appends an email to an IMAP mailbox.

Returns 1 for success, 0 for failure.

(Classic ASP) Send Email and Save Copy to "Sent" Mailbox

(Visual FoxPro) Send Email and Save Copy to "Sent" Mailbox

(PowerBuilder) Send Email and Save Copy to "Sent" Mailbox

(SQL Server) Send Email and Save Copy to "Sent" Mailbox

(Visual Basic 6.0) Send Email and Save Copy to "Sent" Mailbox

(VBScript) Send Email and Save Copy to "Sent" Mailbox

(Classic ASP) Upload (Append) Email to an IMAP Mailbox and get the UID of the Appended Email

(Visual FoxPro) Upload (Append) Email to an IMAP Mailbox and get the UID of the Appended Email

(PowerBuilder) Upload (Append) Email to an IMAP Mailbox and get the UID of the Appended Email

(SQL Server) Upload (Append) Email to an IMAP Mailbox and get the UID of the Appended Email

(Visual Basic 6.0) Upload (Append) Email to an IMAP Mailbox and get the UID of the Appended Email

(VBScript) Upload (Append) Email to an IMAP Mailbox and get the UID of the Appended Email

(Classic ASP) Upload (Append) Email to an IMAP Mailbox

(Visual FoxPro) Upload (Append) Email to an IMAP Mailbox

(PowerBuilder) Upload (Append) Email to an IMAP Mailbox

(SQL Server) Upload (Append) Email to an IMAP Mailbox

(Visual Basic 6.0) Upload (Append) Email to an IMAP Mailbox

(VBScript) Upload (Append) Email to an IMAP Mailbox

AppendMailAsync(mailbox As String, email As ChilkatEmail) As ChilkatTask

Creates an asynchronous task to call the AppendMail method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

(Classic ASP) Async Upload (Append) Email to an IMAP Mailbox

(Visual FoxPro) Async Upload (Append) Email to an IMAP Mailbox

(PowerBuilder) Async Upload (Append) Email to an IMAP Mailbox

(SQL Server) Async Upload (Append) Email to an IMAP Mailbox

(Visual Basic 6.0) Async Upload (Append) Email to an IMAP Mailbox

(VBScript) Async Upload (Append) Email to an IMAP Mailbox

AppendMime(mailbox As String, mimeText As String) As Long

Appends an email (represented as MIME text) to an IMAP mailbox.

Returns 1 for success, 0 for failure.

(Classic ASP) Upload .eml File to an IMAP Mailbox

(Visual FoxPro) Upload .eml File to an IMAP Mailbox

(PowerBuilder) Upload .eml File to an IMAP Mailbox

(SQL Server) Upload .eml File to an IMAP Mailbox

(Visual Basic 6.0) Upload .eml File to an IMAP Mailbox

(VBScript) Upload .eml File to an IMAP Mailbox

AppendMimeAsync(mailbox As String, mimeText As String) As ChilkatTask

Creates an asynchronous task to call the AppendMime method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

AppendMimeWithDate(mailbox As String, mimeText As String, ByVal internalDate As Date) As Long

This method is deprecated. It will be removed in a future version.

The same as AppendMime, but with an extra argument to allow the internal date of the email on the server to be explicitly specified.

Returns 1 for success, 0 for failure.

AppendMimeWithDateStr(mailbox As String, mimeText As String, internalDateStr As String) As Long

The same as AppendMimeWithDate, except the date/time is provided in RFC822 string format.

Returns 1 for success, 0 for failure.

AppendMimeWithDateStrAsync(mailbox As String, mimeText As String, internalDateStr As String) As ChilkatTask

Creates an asynchronous task to call the AppendMimeWithDateStr method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

AppendMimeWithFlags(mailbox As String, mimeText As String, ByVal seen As Long, ByVal flagged As Long, ByVal answered As Long, ByVal draft As Long) As Long

Same as AppendMime, but allows the flags associated with the email to be set at the same time. A flag is on if 1, and off if 0.

Returns 1 for success, 0 for failure.

AppendMimeWithFlagsAsync(mailbox As String, mimeText As String, ByVal seen As Long, ByVal flagged As Long, ByVal answered As Long, ByVal draft As Long) As ChilkatTask

Creates an asynchronous task to call the AppendMimeWithFlags method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

AppendMimeWithFlagsSb(mailbox As String, sbMime As ChilkatStringBuilder, ByVal seen As Long, ByVal flagged As Long, ByVal answered As Long, ByVal draft As Long) As Long

Introduced in version 9.5.0.62

Same as AppendMimeWithFlags, but the MIME to be uploaded to the IMAP server is passed in a StringBuilder object.

Returns 1 for success, 0 for failure.

AppendMimeWithFlagsSbAsync(mailbox As String, sbMime As ChilkatStringBuilder, ByVal seen As Long, ByVal flagged As Long, ByVal answered As Long, ByVal draft As Long) As ChilkatTask

Introduced in version 9.5.0.62

Creates an asynchronous task to call the AppendMimeWithFlagsSb method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

Capability() As String

Sends a CAPABILITY command to the IMAP server and returns the raw response.

Returns Nothing on failure

(Classic ASP) IMAP Capability

(Visual FoxPro) IMAP Capability

(PowerBuilder) IMAP Capability

(SQL Server) IMAP Capability

(Visual Basic 6.0) IMAP Capability

(VBScript) IMAP Capability

CapabilityAsync() As ChilkatTask

Creates an asynchronous task to call the Capability method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

CheckConnection() As Long

Introduced in version 9.5.0.46

Returns 1 if the underlying TCP socket is connected to the IMAP server.

CheckForNewEmail() As MessageSet

Checks for new email that has arrived since the mailbox was selected (via the SelectMailbox or ExamineMailbox methods), or since the last call to CheckForNewEmail (whichever was most recent). This method works by closing and re-opening the currently selected mailbox, and then sending a "SEARCH" command for either RECENT emails, or emails having a UID greater than the UIDNEXT value. A message set object containing the UID's of the new emails is returned, and this may be passed to methods such as FetchBundle to download the new emails.

Returns Nothing on failure

More Information about Checking for New IMAP Email

CheckForNewEmailAsync() As ChilkatTask

Creates an asynchronous task to call the CheckForNewEmail method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

(Classic ASP) How to Return an Object from an Async Task

(Visual FoxPro) How to Return an Object from an Async Task

(PowerBuilder) How to Return an Object from an Async Task

(SQL Server) How to Return an Object from an Async Task

(Visual Basic 6.0) How to Return an Object from an Async Task

(VBScript) How to Return an Object from an Async Task

ClearSessionLog()

Clears the contents of the SessionLog property.

CloseMailbox(mailbox As String) As Long

Closes the currently selected mailbox.

Note: The term "mailbox" and "folder" are synonymous. Whenever the word "mailbox" is used, it has the same meaning as "folder".

Returns 1 for success, 0 for failure.

CloseMailboxAsync(mailbox As String) As ChilkatTask

Creates an asynchronous task to call the CloseMailbox method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

Connect(domainName As String) As Long

Connects to an IMAP server, but does not login. The domainName is the domain name of the IMAP server. (May also use the IPv4 or IPv6 address in string format.)

Important: All TCP-based Internet communications, regardless of the protocol (such as HTTP, FTP, SSH, IMAP, POP3, SMTP, etc.), and regardless of SSL/TLS, begin with establishing a TCP connection to a remote host:port. External security-related infrastructure such as software firewalls (Windows Firewall), hardware firewalls, anti-virus, at either source or destination (or both) can block the connection. If the connection fails, make sure to check all potential external causes of blockage.

Returns 1 for success, 0 for failure.

(Classic ASP) Read iCloud Email Account using IMAP

(Visual FoxPro) Read iCloud Email Account using IMAP

(PowerBuilder) Read iCloud Email Account using IMAP

(SQL Server) Read iCloud Email Account using IMAP

(Visual Basic 6.0) Read iCloud Email Account using IMAP

(VBScript) Read iCloud Email Account using IMAP

ConnectAsync(domainName As String) As ChilkatTask

Creates an asynchronous task to call the Connect method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

Copy(ByVal msgId As Long, ByVal bUid As Long, copyToMailbox As String) As Long

Copies a message from the selected mailbox to copyToMailbox. If bUid is 1, then msgId represents a UID. If bUid is 0, then msgId represents a sequence number.

Returns 1 for success, 0 for failure.

CopyAsync(ByVal msgId As Long, ByVal bUid As Long, copyToMailbox As String) As ChilkatTask

Creates an asynchronous task to call the Copy method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

CopyMultiple(messageSet As MessageSet, copyToMailbox As String) As Long

Same as the Copy method, except an entire set of emails is copied at once. The set of emails is specified in messageSet.

Returns 1 for success, 0 for failure.

CopyMultipleAsync(messageSet As MessageSet, copyToMailbox As String) As ChilkatTask

Creates an asynchronous task to call the CopyMultiple method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

CopySequence(ByVal startSeqNum As Long, ByVal count As Long, copyToMailbox As String) As Long

Copies one or more emails from one mailbox to another. The emails are specified as a range of sequence numbers. The 1st email in a mailbox is always at sequence number 1.

Returns 1 for success, 0 for failure.

CopySequenceAsync(ByVal startSeqNum As Long, ByVal count As Long, copyToMailbox As String) As ChilkatTask

Creates an asynchronous task to call the CopySequence method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

CreateMailbox(mailbox As String) As Long

Creates a new mailbox.

Note: The term "mailbox" and "folder" are synonymous. Whenever the word "mailbox" is used, it has the same meaning as "folder".

Returns 1 for success, 0 for failure.

CreateMailboxAsync(mailbox As String) As ChilkatTask

Creates an asynchronous task to call the CreateMailbox method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

DeleteMailbox(mailbox As String) As Long

Deletes an existing mailbox.

Note: The term "mailbox" and "folder" are synonymous. Whenever the word "mailbox" is used, it has the same meaning as "folder".

Returns 1 for success, 0 for failure.

DeleteMailboxAsync(mailbox As String) As ChilkatTask

Creates an asynchronous task to call the DeleteMailbox method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

Disconnect() As Long

Disconnects cleanly from the IMAP server. A non-success return from this method only indicates that the disconnect was not clean -- and this can typically be ignored.

Returns 1 for success, 0 for failure.

DisconnectAsync() As ChilkatTask

Creates an asynchronous task to call the Disconnect method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

ExamineMailbox(mailbox As String) As Long

Selects a mailbox such that only read-only transactions are allowed. This method would be called instead of SelectMailbox if the logged-on user has read-only permission.

Note: The term "mailbox" and "folder" are synonymous. Whenever the word "mailbox" is used, it has the same meaning as "folder".

Returns 1 for success, 0 for failure.

ExamineMailboxAsync(mailbox As String) As ChilkatTask

Creates an asynchronous task to call the ExamineMailbox method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

Expunge() As Long

Permanently removes from the currently selected mailbox all messages that have the Deleted flag set.

Returns 1 for success, 0 for failure.

ExpungeAsync() As ChilkatTask

Creates an asynchronous task to call the Expunge method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

ExpungeAndClose() As Long

Permanently removes from the currently selected mailbox all messages that have the Deleted flag set, and closes the mailbox.

Returns 1 for success, 0 for failure.

ExpungeAndCloseAsync() As ChilkatTask

Creates an asynchronous task to call the ExpungeAndClose method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

FetchAttachment(emailObject As ChilkatEmail, ByVal attachmentIndex As Long, saveToPath As String) As Long

Downloads one of an email's attachments and saves it to a file. If the emailObject already contains the full email (including the attachments), then no communication with the IMAP server is necessary because the attachment data is already contained within the emailObject. In this case, the attachment is simply extracted and saved to saveToPath. (As with all Chilkat methods, indexing begins at 0. The 1st attachment is at attachmentIndex 0.)

Additional Notes:

If the AutoDownloadAttachments property is set to 0, then emails downloaded via any of the Fetch* methods will not include attachments.

Note: "related" items are not considered attachments and are downloaded. These are images, style sheets, etc. that are embedded within the HTML body of an email.

Also: All signed and/or encrypted emails must be downloaded in full.

When an email is downloaded without attachments, the attachment information is included in header fields. The header fields have names beginning with "ckx-imap-". The attachment information can be obtained via the following methods:

imap.GetMailNumAttach
imap.GetMailAttachFilename
imap.GetMailAttachSize

Returns 1 for success, 0 for failure.

FetchAttachmentAsync(emailObject As ChilkatEmail, ByVal attachmentIndex As Long, saveToPath As String) As ChilkatTask

Creates an asynchronous task to call the FetchAttachment method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

FetchAttachmentBd(email As ChilkatEmail, ByVal attachmentIndex As Long, binData As ChilkatBinData) As Long

Introduced in version 9.5.0.62

Downloads one of an email's attachments and returns the attachment data in a BinData object. ***See the FetchAttachment method description for more information about fetching attachments.

Returns 1 for success, 0 for failure.

FetchAttachmentBdAsync(email As ChilkatEmail, ByVal attachmentIndex As Long, binData As ChilkatBinData) As ChilkatTask

Introduced in version 9.5.0.62

Creates an asynchronous task to call the FetchAttachmentBd method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

FetchAttachmentBytes(email As ChilkatEmail, ByVal attachIndex As Long) As Variant

Downloads one of an email's attachments and returns the attachment data as in-memory bytes that may be accessed by an application. ***See the FetchAttachment method description for more information about fetching attachments.

Returns a zero-length byte array (as a Variant) on failure.
An empty array will have a UBound of -1 meaning 0 elements.

FetchAttachmentBytesAsync(email As ChilkatEmail, ByVal attachIndex As Long) As ChilkatTask

Creates an asynchronous task to call the FetchAttachmentBytes method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

FetchAttachmentSb(email As ChilkatEmail, ByVal attachmentIndex As Long, charset As String, sb As ChilkatStringBuilder) As Long

Introduced in version 9.5.0.62

Downloads one of an email's attachments and returns the attachment data in a StringBuilder. It only makes sense to call this method for attachments that contain text data. The charset indicates the character encoding of the text, such as "utf-8" or "windows-1252". ***See the FetchAttachment method description for more information about fetching attachments.

Returns 1 for success, 0 for failure.

FetchAttachmentSbAsync(email As ChilkatEmail, ByVal attachmentIndex As Long, charset As String, sb As ChilkatStringBuilder) As ChilkatTask

Introduced in version 9.5.0.62

Creates an asynchronous task to call the FetchAttachmentSb method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

FetchAttachmentString(emailObject As ChilkatEmail, ByVal attachmentIndex As Long, charset As String) As String

Downloads one of an email's attachments and returns the attachment data as a string. It only makes sense to call this method for attachments that contain text data. The charset indicates the character encoding of the text, such as "utf-8" or "windows-1252". ***See the FetchAttachment method description for more information about fetching attachments.

Returns Nothing on failure

FetchAttachmentStringAsync(emailObject As ChilkatEmail, ByVal attachmentIndex As Long, charset As String) As ChilkatTask

Creates an asynchronous task to call the FetchAttachmentString method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

FetchBundle(messageSet As MessageSet) As ChilkatEmailBundle

Retrieves a set of messages from the IMAP server and returns them in an email bundle object. If the method fails, it may return a NULL reference.

Returns Nothing on failure

FetchBundleAsync(messageSet As MessageSet) As ChilkatTask

Creates an asynchronous task to call the FetchBundle method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

(Classic ASP) How to Return an Object from an Async Task

(Visual FoxPro) How to Return an Object from an Async Task

(PowerBuilder) How to Return an Object from an Async Task

(SQL Server) How to Return an Object from an Async Task

(Visual Basic 6.0) How to Return an Object from an Async Task

(VBScript) How to Return an Object from an Async Task

FetchBundleAsMime(messageSet As MessageSet) As CkStringArray

Retrieves a set of messages from the IMAP server and returns them in a string array object (NOTE: it does not return a string array, but an object that represents a string array.) Each string within the returned object is the complete MIME source of an email. On failure, a NULL object reference is returned.

Returns Nothing on failure

FetchBundleAsMimeAsync(messageSet As MessageSet) As ChilkatTask

Creates an asynchronous task to call the FetchBundleAsMime method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

(Classic ASP) How to Return an Object from an Async Task

(Visual FoxPro) How to Return an Object from an Async Task

(PowerBuilder) How to Return an Object from an Async Task

(SQL Server) How to Return an Object from an Async Task

(Visual Basic 6.0) How to Return an Object from an Async Task

(VBScript) How to Return an Object from an Async Task

FetchChunk(ByVal startSeqNum As Long, ByVal count As Long, failedSet As MessageSet, fetchedSet As MessageSet) As ChilkatEmailBundle

Fetches a chunk of emails starting at a specific sequence number. A bundle of fetched emails is returned. The last two arguments are message sets that are updated with the ids of messages successfully/unsuccessfully fetched.

Returns Nothing on failure

FetchChunkAsync(ByVal startSeqNum As Long, ByVal count As Long, failedSet As MessageSet, fetchedSet As MessageSet) As ChilkatTask

Creates an asynchronous task to call the FetchChunk method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

(Classic ASP) How to Return an Object from an Async Task

(Visual FoxPro) How to Return an Object from an Async Task

(PowerBuilder) How to Return an Object from an Async Task

(SQL Server) How to Return an Object from an Async Task

(Visual Basic 6.0) How to Return an Object from an Async Task

(VBScript) How to Return an Object from an Async Task

FetchFlags(ByVal msgId As Long, ByVal bUid As Long) As String

Fetches the flags for an email. The bUid argument determines whether the msgId is a UID or sequence number.

Returns the SPACE separated list of flags set for the email, such as "\Flagged \Seen $label1".

If an empty string is returned, then it could be that the email referenced by msgId does not exist in the currently selected mailbox, or it simply has no flags that are set. To determine the difference, examine the contents of the LastResponse property. For the case where the message does not exist, the LastResponse will contain a "NO" and will look something like this:

aaah NO The specified message set is invalid.
For the case where the message exists, but no flags are set, the LastResponse will contain an "OK" in the last response line. For example:
...
aaah OK FETCH completed.

Returns Nothing on failure

FetchFlagsAsync(ByVal msgId As Long, ByVal bUid As Long) As ChilkatTask

Creates an asynchronous task to call the FetchFlags method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

FetchHeaders(messageSet As MessageSet) As ChilkatEmailBundle

Retrieves a set of message headers from the IMAP server and returns them in an email bundle object. If the method fails, it may return a NULL reference. The following methods are useful for retrieving information about attachments and flags after email headers are retrieved: GetMailNumAttach, GetMailAttachSize, GetMailAttachFilename, GetMailFlag.

Returns Nothing on failure

(Classic ASP) Read IMAP Email Headers

(Visual FoxPro) Read IMAP Email Headers

(PowerBuilder) Read IMAP Email Headers

(SQL Server) Read IMAP Email Headers

(Visual Basic 6.0) Read IMAP Email Headers

(VBScript) Read IMAP Email Headers

Getting Attachment Information

FetchHeadersAsync(messageSet As MessageSet) As ChilkatTask

Creates an asynchronous task to call the FetchHeaders method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

(Classic ASP) How to Return an Object from an Async Task

(Visual FoxPro) How to Return an Object from an Async Task

(PowerBuilder) How to Return an Object from an Async Task

(SQL Server) How to Return an Object from an Async Task

(Visual Basic 6.0) How to Return an Object from an Async Task

(VBScript) How to Return an Object from an Async Task

FetchSequence(ByVal startSeqNum As Long, ByVal numMessages As Long) As ChilkatEmailBundle

Downloads email for a range of sequence numbers. The 1st email in a mailbox is always at sequence number 1. The total number of emails in the currently selected mailbox is available in the NumMessages property. If the numMessages is too large, the method will still succeed, but will return a bundle of emails from startSeqNum to the last email in the mailbox.

Returns Nothing on failure

FetchSequenceAsync(ByVal startSeqNum As Long, ByVal numMessages As Long) As ChilkatTask

Creates an asynchronous task to call the FetchSequence method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

(Classic ASP) How to Return an Object from an Async Task

(Visual FoxPro) How to Return an Object from an Async Task

(PowerBuilder) How to Return an Object from an Async Task

(SQL Server) How to Return an Object from an Async Task

(Visual Basic 6.0) How to Return an Object from an Async Task

(VBScript) How to Return an Object from an Async Task

FetchSequenceAsMime(ByVal startSeqNum As Long, ByVal numMessages As Long) As CkStringArray

Same as FetchSequence, but instead of returning email objects in a bundle, the raw MIME of each email is returned.

Returns Nothing on failure

FetchSequenceAsMimeAsync(ByVal startSeqNum As Long, ByVal numMessages As Long) As ChilkatTask

Creates an asynchronous task to call the FetchSequenceAsMime method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

(Classic ASP) How to Return an Object from an Async Task

(Visual FoxPro) How to Return an Object from an Async Task

(PowerBuilder) How to Return an Object from an Async Task

(SQL Server) How to Return an Object from an Async Task

(Visual Basic 6.0) How to Return an Object from an Async Task

(VBScript) How to Return an Object from an Async Task

FetchSequenceHeaders(ByVal startSeqNum As Long, ByVal numMessages As Long) As ChilkatEmailBundle

Same as FetchSequence, but only the email headers are returned. The email objects within the bundle will be lacking bodies and attachments.

Note: For any method call using sequence numbers, an application must make sure the sequence numbers are within the valid range. When a mailbox is selected, the NumMessages property will have been set, and the valid range of sequence numbers is from 1 to NumMessages. An attempt to fetch sequence numbers outside this range will result in an error.

Returns Nothing on failure

Getting Attachment Information

(Classic ASP) Fetch Inbox Email Headers

(Visual FoxPro) Fetch Inbox Email Headers

(PowerBuilder) Fetch Inbox Email Headers

(SQL Server) Fetch Inbox Email Headers

(Visual Basic 6.0) Fetch Inbox Email Headers

(VBScript) Fetch Inbox Email Headers

FetchSequenceHeadersAsync(ByVal startSeqNum As Long, ByVal numMessages As Long) As ChilkatTask

Creates an asynchronous task to call the FetchSequenceHeaders method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

(Classic ASP) How to Return an Object from an Async Task

(Visual FoxPro) How to Return an Object from an Async Task

(PowerBuilder) How to Return an Object from an Async Task

(SQL Server) How to Return an Object from an Async Task

(Visual Basic 6.0) How to Return an Object from an Async Task

(VBScript) How to Return an Object from an Async Task

FetchSingle(ByVal msgId As Long, ByVal bUid As Long) As ChilkatEmail

Retrieves a single message from the IMAP server. If the method fails, it may return a NULL reference. If bUid is true, then msgID represents a UID. If bUid is false, then msgID represents a sequence number.

Returns Nothing on failure

(Classic ASP) IMAP Download All Email as MIME One at a Time

(Visual FoxPro) IMAP Download All Email as MIME One at a Time

(PowerBuilder) IMAP Download All Email as MIME One at a Time

(SQL Server) IMAP Download All Email as MIME One at a Time

(Visual Basic 6.0) IMAP Download All Email as MIME One at a Time

(VBScript) IMAP Download All Email as MIME One at a Time

Understanding IMAP Email Attachments

FetchSingleAsync(ByVal msgId As Long, ByVal bUid As Long) As ChilkatTask

Creates an asynchronous task to call the FetchSingle method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

(Classic ASP) How to Return an Object from an Async Task

(Visual FoxPro) How to Return an Object from an Async Task

(PowerBuilder) How to Return an Object from an Async Task

(SQL Server) How to Return an Object from an Async Task

(Visual Basic 6.0) How to Return an Object from an Async Task

(VBScript) How to Return an Object from an Async Task

FetchSingleAsMime(ByVal msgId As Long, ByVal bUid As Long) As String

Retrieves a single message from the IMAP server and returns a string containing the complete MIME source of the email. If the method fails, it returns a NULL reference. If bUid is true, then msgID represents a UID. If bUid is false, then msgID represents a sequence number.

Returns Nothing on failure

(Classic ASP) IMAP Download All Email as MIME One at a Time

(Visual FoxPro) IMAP Download All Email as MIME One at a Time

(PowerBuilder) IMAP Download All Email as MIME One at a Time

(SQL Server) IMAP Download All Email as MIME One at a Time

(Visual Basic 6.0) IMAP Download All Email as MIME One at a Time

(VBScript) IMAP Download All Email as MIME One at a Time

FetchSingleAsMimeAsync(ByVal msgId As Long, ByVal bUid As Long) As ChilkatTask

Creates an asynchronous task to call the FetchSingleAsMime method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

FetchSingleAsMimeSb(ByVal msgId As Long, ByVal bUid As Long, sbMime As ChilkatStringBuilder) As Long

Introduced in version 9.5.0.62

Retrieves a single message from the IMAP server and returns a StringBuilder object containing the complete MIME source of the email. If the method fails, it returns a NULL reference. If bUid is true, then msgID represents a UID. If bUid is false, then msgID represents a sequence number.

Returns 1 for success, 0 for failure.

FetchSingleAsMimeSbAsync(ByVal msgId As Long, ByVal bUid As Long, sbMime As ChilkatStringBuilder) As ChilkatTask

Introduced in version 9.5.0.62

Creates an asynchronous task to call the FetchSingleAsMimeSb method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

FetchSingleHeader(ByVal msgId As Long, ByVal bUid As Long) As ChilkatEmail

Retrieves a single message header from the IMAP server. If the method fails, it may return a NULL reference. The following methods are useful for retrieving information about attachments and flags after an email header is retrieved: GetMailNumAttach, GetMailAttachSize, GetMailAttachFilename, GetMailFlag. If bUid is true, then msgID represents a UID. If bUid is false, then msgID represents a sequence number.

Returns Nothing on failure

Getting Attachment Information

(Classic ASP) Fetch Full Email Given Email Header

(Visual FoxPro) Fetch Full Email Given Email Header

(PowerBuilder) Fetch Full Email Given Email Header

(SQL Server) Fetch Full Email Given Email Header

(Visual Basic 6.0) Fetch Full Email Given Email Header

(VBScript) Fetch Full Email Given Email Header

FetchSingleHeaderAsync(ByVal msgId As Long, ByVal bUid As Long) As ChilkatTask

Creates an asynchronous task to call the FetchSingleHeader method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

(Classic ASP) How to Return an Object from an Async Task

(Visual FoxPro) How to Return an Object from an Async Task

(PowerBuilder) How to Return an Object from an Async Task

(SQL Server) How to Return an Object from an Async Task

(Visual Basic 6.0) How to Return an Object from an Async Task

(VBScript) How to Return an Object from an Async Task

FetchSingleHeaderAsMime(ByVal msgId As Long, ByVal bUID As Long) As String

Fetches and returns the MIME of a single email header.

Returns Nothing on failure

FetchSingleHeaderAsMimeAsync(ByVal msgId As Long, ByVal bUID As Long) As ChilkatTask

Creates an asynchronous task to call the FetchSingleHeaderAsMime method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

GetAllUids() As MessageSet

Returns a message set object containing all the UIDs in the currently selected mailbox. A NULL object reference is returned on failure.

Returns Nothing on failure

GetAllUidsAsync() As ChilkatTask

Creates an asynchronous task to call the GetAllUids method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

(Classic ASP) How to Return an Object from an Async Task

(Visual FoxPro) How to Return an Object from an Async Task

(PowerBuilder) How to Return an Object from an Async Task

(SQL Server) How to Return an Object from an Async Task

(Visual Basic 6.0) How to Return an Object from an Async Task

(VBScript) How to Return an Object from an Async Task

GetMailAttachFilename(email As ChilkatEmail, ByVal attachIndex As Long) As String

Returns the Nth attachment filename. Indexing begins at 0.

Returns Nothing on failure

Getting Attachment Information

Understanding IMAP Email Attachments

GetMailAttachSize(email As ChilkatEmail, ByVal attachIndex As Long) As Long

Returns the Nth attachment size in bytes. Indexing begins at 0.

Getting Attachment Information

Understanding IMAP Email Attachments

GetMailboxStatus(mailbox As String) As String

Introduced in version 9.5.0.46

Sends a "Status" command to get the status of a mailbox. Returns an XML string containing the status values as named attributes. Possible status values are:

  • messages: The number of messages in the mailbox.
  • recent: The number of messages with the \Recent flag set.
  • uidnext: The next unique identifier value of the mailbox.
  • uidvalidity: The unique identifier validity value of the mailbox.
  • unseen: The number of messages which do not have the \Seen flag set.

An example of the string returned by this method is: <status messages="240" recent="0" uidnext="3674" uidvalidity="3" unseen="213" />

Returns Nothing on failure

GetMailboxStatusAsync(mailbox As String) As ChilkatTask

Introduced in version 9.5.0.46

Creates an asynchronous task to call the GetMailboxStatus method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

GetMailFlag(email As ChilkatEmail, flagName As String) As Long

Returns the value of a flag (1 = yes, 0 = no) for an email. Both standard system flags as well as custom flags may be set. Standard system flags typically begin with a backslash character, such as "\Seen", "\Answered", "\Flagged", "\Draft", "\Deleted", and "\Answered". Custom flags can be anything, such as "NonJunk", "$label1", "$MailFlagBit1", etc. .

Understanding IMAP Email Attachments

GetMailNumAttach(email As ChilkatEmail) As Long

Returns the number of email attachments.

Getting Attachment Information

Understanding IMAP Email Attachments

GetMailSize(email As ChilkatEmail) As Long

Returns the size (in bytes) of the entire email including attachments.

Understanding IMAP Email Attachments

GetQuota(quotaRoot As String) As String

Introduced in version 9.5.0.58

Sends the GETQUOTA command and returns the response in JSON format. This feature is only possible with IMAP servers that support the QUOTA extension/capability.

Returns Nothing on failure

(Classic ASP) IMAP Get Quota

(Visual FoxPro) IMAP Get Quota

(PowerBuilder) IMAP Get Quota

(SQL Server) IMAP Get Quota

(Visual Basic 6.0) IMAP Get Quota

(VBScript) IMAP Get Quota

GetQuotaAsync(quotaRoot As String) As ChilkatTask

Introduced in version 9.5.0.58

Creates an asynchronous task to call the GetQuota method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

GetQuotaRoot(mailboxName As String) As String

Introduced in version 9.5.0.58

Sends the GETQUOTAROOT command and returns the response in JSON format. This feature is only possible with IMAP servers that support the QUOTA extension/capability.

Returns Nothing on failure

(Classic ASP) IMAP Get Quota Root

(Visual FoxPro) IMAP Get Quota Root

(PowerBuilder) IMAP Get Quota Root

(SQL Server) IMAP Get Quota Root

(Visual Basic 6.0) IMAP Get Quota Root

(VBScript) IMAP Get Quota Root

GetQuotaRootAsync(mailboxName As String) As ChilkatTask

Introduced in version 9.5.0.58

Creates an asynchronous task to call the GetQuotaRoot method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

GetSslServerCert() As ChilkatCert

Returns the IMAP server's digital certificate (for SSL / TLS connections).

Returns Nothing on failure

HasCapability(name As String, capabilityResponse As String) As Long

Introduced in version 9.5.0.58

Returns 1 if the capability indicated by name is found in the capabilityResponse. Otherwise returns 0.

(Classic ASP) IMAP Capability

(Visual FoxPro) IMAP Capability

(PowerBuilder) IMAP Capability

(SQL Server) IMAP Capability

(Visual Basic 6.0) IMAP Capability

(VBScript) IMAP Capability

IdleCheck(ByVal timeoutMs As Long) As String

Introduced in version 9.5.0.26

Polls the connection to see if any real-time updates are available. The timeoutMs indicates how long to wait for incoming updates. This method does not send a command to the IMAP server, it simply checks the connection for already-arrived messages that the IMAP server sent. This method would only be called after IDLE has already been started via the IdleStart method.

If updates are available, they are returned in an XML string having the format as shown below. There is one child node for each notification. The possible notifcations are:

  1. flags -- lists flags that have been set or unset for an email.
  2. expunge -- provides the sequence number for an email that has been deleted.
  3. exists -- reports the new number of messages in the currently selected mailbox.
  4. recent -- reports the new number of messages with the /RECENT flag set.
  5. raw -- reports an unanticipated response line that was not parsed by Chilkat. This should be reported to support@chilkatoft.com

A sample showing all possible notifications (except for "raw") is shown below.

<idle>
    <flags seqnum="59" uid="11876">
        <flag>\Deleted</flag>
        <flag>\Seen</flag>
    </flags>
    <flags seqnum="69" uid="11889">
        <flag>\Seen</flag>
    </flags>
    <expunge>58</expunge>
    <expunge>58</expunge>
    <expunge>67</expunge>
    <exists>115</exists>
    <recent>0</recent>
</idle>

If no updates have been received, the returned XML string has the following format, as shown below. The

<idle></idle>

NOTE:Once IdleStart has been called, this method can and should be called frequently to see if any updates have arrived. This is NOT the same as polling the IMAP server because it does not send any requests to the IMAP server. It simply checks to see if any messages (i.e. updates) from the IMAP server are available and waiting to be read.

Returns Nothing on failure

(Classic ASP) Using IMAP IDLE to Wait for Updates

(Visual FoxPro) Using IMAP IDLE to Wait for Updates

(PowerBuilder) Using IMAP IDLE to Wait for Updates

(SQL Server) Using IMAP IDLE to Wait for Updates

(Visual Basic 6.0) Using IMAP IDLE to Wait for Updates

(VBScript) Using IMAP IDLE to Wait for Updates

IdleCheckAsync(ByVal timeoutMs As Long) As ChilkatTask

Introduced in version 9.5.0.26

Creates an asynchronous task to call the IdleCheck method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

IdleDone() As Long

Introduced in version 9.5.0.26

Sends a command to the IMAP server to stop receiving real-time updates.

Returns 1 for success, 0 for failure.

(Classic ASP) Using IMAP IDLE to Wait for Updates

(Visual FoxPro) Using IMAP IDLE to Wait for Updates

(PowerBuilder) Using IMAP IDLE to Wait for Updates

(SQL Server) Using IMAP IDLE to Wait for Updates

(Visual Basic 6.0) Using IMAP IDLE to Wait for Updates

(VBScript) Using IMAP IDLE to Wait for Updates

IdleDoneAsync() As ChilkatTask

Introduced in version 9.5.0.26

Creates an asynchronous task to call the IdleDone method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

IdleStart() As Long

Introduced in version 9.5.0.26

Sends an IDLE command to the IMAP server to begin receiving real-time updates.

Returns 1 for success, 0 for failure.

(Classic ASP) Using IMAP IDLE to Wait for Updates

(Visual FoxPro) Using IMAP IDLE to Wait for Updates

(PowerBuilder) Using IMAP IDLE to Wait for Updates

(SQL Server) Using IMAP IDLE to Wait for Updates

(Visual Basic 6.0) Using IMAP IDLE to Wait for Updates

(VBScript) Using IMAP IDLE to Wait for Updates

IdleStartAsync() As ChilkatTask

Introduced in version 9.5.0.26

Creates an asynchronous task to call the IdleStart method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

IsConnected() As Long

Returns the last known "connected" state with the IMAP server. IsConnected does not send a message to the IMAP server to determine if it is still connected. The Noop method may be called to specifically send a no-operation message to determine actual connectivity.

The IsConnected method is useful for checking to see if the component is already in a known disconnected state.

IsLoggedIn() As Long

Returns 1 if already logged into an IMAP server, otherwise returns 0.

IsUnlocked() As Long

Returns 1 if the component is unlocked, 0 if not.

ListMailboxes(reference As String, wildcardedMailbox As String) As Mailboxes

Returns a subset of the complete list of mailboxes available on the IMAP server. This method has the side-effect of setting the SeparatorChar property to the correct character used by the IMAP server, which is typically "/" or ".".

Note: The term "mailbox" and "folder" are synonymous. Whenever the word "mailbox" is used, it has the same meaning as "folder".

The reference and wildcardedMailbox parameters are passed unaltered to the IMAP LIST command:


FROM RFC 3501 (IMAP Protocol)

      The LIST command returns a subset of names from the complete set
      of all names available to the client.  Zero or more untagged LIST
      replies are returned, containing the name attributes, hierarchy
      delimiter, and name; see the description of the LIST reply for
      more detail.

      An empty ("" string) reference name argument indicates that the
      mailbox name is interpreted as by SELECT.  The returned mailbox
      names MUST match the supplied mailbox name pattern.  A non-empty
      reference name argument is the name of a mailbox or a level of
      mailbox hierarchy, and indicates the context in which the mailbox
      name is interpreted.

      An empty ("" string) mailbox name argument is a special request to
      return the hierarchy delimiter and the root name of the name given
      in the reference.  The value returned as the root MAY be the empty
      string if the reference is non-rooted or is an empty string.  In
      all cases, a hierarchy delimiter (or NIL if there is no hierarchy)
      is returned.  This permits a client to get the hierarchy delimiter
      (or find out that the mailbox names are flat) even when no
      mailboxes by that name currently exist.

      The reference and mailbox name arguments are interpreted into a
      canonical form that represents an unambiguous left-to-right
      hierarchy.  The returned mailbox names will be in the interpreted
      form.

           Note: The interpretation of the reference argument is
           implementation-defined.  It depends upon whether the
           server implementation has a concept of the "current
           working directory" and leading "break out characters",
           which override the current working directory.

           For example, on a server which exports a UNIX or NT
           filesystem, the reference argument contains the current
           working directory, and the mailbox name argument would
           contain the name as interpreted in the current working
           directory.

           If a server implementation has no concept of break out
           characters, the canonical form is normally the reference
           name appended with the mailbox name.  Note that if the
           server implements the namespace convention (section
           5.1.2), "#" is a break out character and must be treated
           as such.

           If the reference argument is not a level of mailbox
           hierarchy (that is, it is a \NoInferiors name), and/or
           the reference argument does not end with the hierarchy
           delimiter, it is implementation-dependent how this is
           interpreted.  For example, a reference of "foo/bar" and
           mailbox name of "rag/baz" could be interpreted as
           "foo/bar/rag/baz", "foo/barrag/baz", or "foo/rag/baz".
           A client SHOULD NOT use such a reference argument except
           at the explicit request of the user.  A hierarchical
           browser MUST NOT make any assumptions about server
           interpretation of the reference unless the reference is
           a level of mailbox hierarchy AND ends with the hierarchy
           delimiter.

      Any part of the reference argument that is included in the
      interpreted form SHOULD prefix the interpreted form.  It SHOULD
      also be in the same form as the reference name argument.  This
      rule permits the client to determine if the returned mailbox name
      is in the context of the reference argument, or if something about
      the mailbox argument overrode the reference argument.  Without
      this rule, the client would have to have knowledge of the server's
      naming semantics including what characters are "breakouts" that
      override a naming context.

           For example, here are some examples of how references
           and mailbox names might be interpreted on a UNIX-based
           server:

               Reference     Mailbox Name  Interpretation
               ------------  ------------  --------------
               ~smith/Mail/  foo.*         ~smith/Mail/foo.*
               archive/      %             archive/%
               #news.        comp.mail.*   #news.comp.mail.*
               ~smith/Mail/  /usr/doc/foo  /usr/doc/foo
               archive/      ~fred/Mail/*  ~fred/Mail/*

           The first three examples demonstrate interpretations in
           the context of the reference argument.  Note that
           "~smith/Mail" SHOULD NOT be transformed into something
           like "/u2/users/smith/Mail", or it would be impossible
           for the client to determine that the interpretation was
           in the context of the reference.

      The character "*" is a wildcard, and matches zero or more
      characters at this position.  The character "%" is similar to "*",
      but it does not match a hierarchy delimiter.  If the "%" wildcard
      is the last character of a mailbox name argument, matching levels
      of hierarchy are also returned.  If these levels of hierarchy are
      not also selectable mailboxes, they are returned with the
      \Noselect mailbox name attribute (see the description of the LIST
      response for more details).

      Server implementations are permitted to "hide" otherwise
      accessible mailboxes from the wildcard characters, by preventing
      certain characters or names from matching a wildcard in certain
      situations.  For example, a UNIX-based server might restrict the
      interpretation of "*" so that an initial "/" character does not
      match.

      The special name INBOX is included in the output from LIST, if
      INBOX is supported by this server for this user and if the
      uppercase string "INBOX" matches the interpreted reference and
      mailbox name arguments with wildcards as described above.  The
      criteria for omitting INBOX is whether SELECT INBOX will return
      failure; it is not relevant whether the user's real INBOX resides
      on this or some other server.

Returns Nothing on failure

(Classic ASP) List IMAP Mailboxes

(Visual FoxPro) List IMAP Mailboxes

(PowerBuilder) List IMAP Mailboxes

(SQL Server) List IMAP Mailboxes

(Visual Basic 6.0) List IMAP Mailboxes

(VBScript) List IMAP Mailboxes

ListMailboxesAsync(reference As String, wildcardedMailbox As String) As ChilkatTask

Creates an asynchronous task to call the ListMailboxes method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

(Classic ASP) How to Return an Object from an Async Task

(Visual FoxPro) How to Return an Object from an Async Task

(PowerBuilder) How to Return an Object from an Async Task

(SQL Server) How to Return an Object from an Async Task

(Visual Basic 6.0) How to Return an Object from an Async Task

(VBScript) How to Return an Object from an Async Task

ListSubscribed(reference As String, wildcardedMailbox As String) As Mailboxes

The same as ListMailboxes, but returns only the subscribed mailboxes. (See ListMailboxes for more information.)

Returns Nothing on failure

ListSubscribedAsync(reference As String, wildcardedMailbox As String) As ChilkatTask

Creates an asynchronous task to call the ListSubscribed method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

(Classic ASP) How to Return an Object from an Async Task

(Visual FoxPro) How to Return an Object from an Async Task

(PowerBuilder) How to Return an Object from an Async Task

(SQL Server) How to Return an Object from an Async Task

(Visual Basic 6.0) How to Return an Object from an Async Task

(VBScript) How to Return an Object from an Async Task

Login(loginName As String, password As String) As Long

Logs into the IMAP server. The component must first be connected to an IMAP server by calling Connect. If XOAUTH2 authentication is required, pass the XOAUTH2 access token in place of the password. (For GMail, the Chilkat HTTP class/object's G_SvcOauthAccessToken method can be called to obtain an XOAUTH2 access token.)

To authenticate using XOAUTH2, make sure the AuthMethod property is set to "XOAUTH2". The XOAUTH2 authentication functionality was added in version 9.5.0.44.

Returns 1 for success, 0 for failure.

(Classic ASP) OAuth2 GMail IMAP Authentication

(Visual FoxPro) OAuth2 GMail IMAP Authentication

(PowerBuilder) OAuth2 GMail IMAP Authentication

(SQL Server) OAuth2 GMail IMAP Authentication

(Visual Basic 6.0) OAuth2 GMail IMAP Authentication

(VBScript) OAuth2 GMail IMAP Authentication

Non-standard Yahoo! IMAP Server Requirements

LoginAsync(loginName As String, password As String) As ChilkatTask

Creates an asynchronous task to call the Login method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

LoginSecure(loginName As ChilkatSecureString, password As ChilkatSecureString) As Long

Introduced in version 9.5.0.71

The same as Login, except the login name and password are passed as secure strings.

Returns 1 for success, 0 for failure.

(Classic ASP) IMAP Login Secure

(Visual FoxPro) IMAP Login Secure

(PowerBuilder) IMAP Login Secure

(SQL Server) IMAP Login Secure

(Visual Basic 6.0) IMAP Login Secure

(VBScript) IMAP Login Secure

LoginSecureAsync(loginName As ChilkatSecureString, password As ChilkatSecureString) As ChilkatTask

Introduced in version 9.5.0.71

Creates an asynchronous task to call the LoginSecure method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

Logout() As Long

Logs out of the IMAP server.

Returns 1 for success, 0 for failure.

LogoutAsync() As ChilkatTask

Creates an asynchronous task to call the Logout method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

MoveMessages(messageSet As MessageSet, destFolder As String) As Long

Introduced in version 9.5.0.64

Moves a set of messages from one mailbox to another. Note: This is only possible if the IMAP server supports the "MOVE" extension. The messageSet contains message UIDs or sequence numbers for messages in the currently selected mailbox. The destFolder is the destination mailbox/folder.

Returns 1 for success, 0 for failure.

(Classic ASP) IMAP Move Messages to another Mailbox

(Visual FoxPro) IMAP Move Messages to another Mailbox

(PowerBuilder) IMAP Move Messages to another Mailbox

(SQL Server) IMAP Move Messages to another Mailbox

(Visual Basic 6.0) IMAP Move Messages to another Mailbox

(VBScript) IMAP Move Messages to another Mailbox

MoveMessagesAsync(messageSet As MessageSet, destFolder As String) As ChilkatTask

Introduced in version 9.5.0.64

Creates an asynchronous task to call the MoveMessages method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

Noop() As Long

Sends a NOOP command to the IMAP server and receives the response. The component must be connected and authenticated for this to succeed. Sending a NOOP is a good way of determining whether the connection to the IMAP server is up and active.

Returns 1 for success, 0 for failure.

NoopAsync() As ChilkatTask

Creates an asynchronous task to call the Noop method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

RefetchMailFlags(email As ChilkatEmail) As Long

Fetches the flags for an email and updates the flags in the email's header. When an email is retrieved from the IMAP server, it embeds the flags into the header in fields beginning with "ckx-". Methods such as GetMailFlag read these header fields.

Returns 1 for success, 0 for failure.

RefetchMailFlagsAsync(email As ChilkatEmail) As ChilkatTask

Creates an asynchronous task to call the RefetchMailFlags method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

RenameMailbox(fromMailbox As String, toMailbox As String) As Long

Renames a mailbox.

Returns 1 for success, 0 for failure.

RenameMailboxAsync(fromMailbox As String, toMailbox As String) As ChilkatTask

Creates an asynchronous task to call the RenameMailbox method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

Search(criteria As String, ByVal bUid As Long) As MessageSet

Searches the selected mailbox for messages that meet a given criteria and returns a message set of all matching messages. If bUid is true, then UIDs are returned in the message set, otherwise sequence numbers are returned. The criteria is passed through to the low-level IMAP protocol unmodified, so the rules for the IMAP SEARCH command (RFC 3501) apply and are reproduced here:


FROM RFC 3501 (IMAP Protocol)

      The SEARCH command searches the mailbox for messages that match
      the given searching criteria.  Searching criteria consist of one
      or more search keys.  The untagged SEARCH response from the server
      contains a listing of message sequence numbers corresponding to
      those messages that match the searching criteria.

      When multiple keys are specified, the result is the intersection
      (AND function) of all the messages that match those keys.  For
      example, the criteria DELETED FROM "SMITH" SINCE 1-Feb-1994 refers
      to all deleted messages from Smith that were placed in the mailbox
      since February 1, 1994.  A search key can also be a parenthesized
      list of one or more search keys (e.g., for use with the OR and NOT
      keys).

      Server implementations MAY exclude [MIME-IMB] body parts with
      terminal content media types other than TEXT and MESSAGE from
      consideration in SEARCH matching.

      The OPTIONAL [CHARSET] specification consists of the word
      "CHARSET" followed by a registered [CHARSET].  It indicates the
      [CHARSET] of the strings that appear in the search criteria.
      [MIME-IMB] content transfer encodings, and [MIME-HDRS] strings in
      [RFC-2822]/[MIME-IMB] headers, MUST be decoded before comparing
      text in a [CHARSET] other than US-ASCII.  US-ASCII MUST be
      supported; other [CHARSET]s MAY be supported.

      If the server does not support the specified [CHARSET], it MUST
      return a tagged NO response (not a BAD).  This response SHOULD
      contain the BADCHARSET response code, which MAY list the
      [CHARSET]s supported by the server.

      In all search keys that use strings, a message matches the key if
      the string is a substring of the field.  The matching is
      case-insensitive.

      The defined search keys are as follows.  Refer to the Formal
      Syntax section for the precise syntactic definitions of the
      arguments.

      
         Messages with message sequence numbers corresponding to the
         specified message sequence number set.

      ALL
         All messages in the mailbox; the default initial key for
         ANDing.

      ANSWERED
         Messages with the \Answered flag set.

      BCC 
         Messages that contain the specified string in the envelope
         structure's BCC field.

      BEFORE 
         Messages whose internal date (disregarding time and timezone)
         is earlier than the specified date.

      BODY 
         Messages that contain the specified string in the body of the
         message.

      CC 
         Messages that contain the specified string in the envelope
         structure's CC field.

      DELETED
         Messages with the \Deleted flag set.

      DRAFT
         Messages with the \Draft flag set.

      FLAGGED
         Messages with the \Flagged flag set.

      FROM 
         Messages that contain the specified string in the envelope
         structure's FROM field.

      HEADER  
         Messages that have a header with the specified field-name (as
         defined in [RFC-2822]) and that contains the specified string
         in the text of the header (what comes after the colon).  If the
         string to search is zero-length, this matches all messages that
         have a header line with the specified field-name regardless of
         the contents.

      KEYWORD 
         Messages with the specified keyword flag set.

      LARGER 
         Messages with an [RFC-2822] size larger than the specified
         number of octets.

      NEW
         Messages that have the \Recent flag set but not the \Seen flag.
         This is functionally equivalent to "(RECENT UNSEEN)".

      NOT 
         Messages that do not match the specified search key.

      OLD
         Messages that do not have the \Recent flag set.  This is
         functionally equivalent to "NOT RECENT" (as opposed to "NOT
         NEW").

      ON 
         Messages whose internal date (disregarding time and timezone)
         is within the specified date.

      OR  
         Messages that match either search key.

      RECENT
         Messages that have the \Recent flag set.

      SEEN
         Messages that have the \Seen flag set.

      SENTBEFORE 
         Messages whose [RFC-2822] Date: header (disregarding time and
         timezone) is earlier than the specified date.

      SENTON 
         Messages whose [RFC-2822] Date: header (disregarding time and
         timezone) is within the specified date.

      SENTSINCE 
         Messages whose [RFC-2822] Date: header (disregarding time and
         timezone) is within or later than the specified date.

      SINCE 
         Messages whose internal date (disregarding time and timezone)
         is within or later than the specified date.

      SMALLER 
         Messages with an [RFC-2822] size smaller than the specified
         number of octets.

      SUBJECT 
         Messages that contain the specified string in the envelope
         structure's SUBJECT field.

      TEXT 
         Messages that contain the specified string in the header or
         body of the message.

      TO 
         Messages that contain the specified string in the envelope
         structure's TO field.

      UID 
         Messages with unique identifiers corresponding to the specified
         unique identifier set.  Sequence set ranges are permitted.

      UNANSWERED
         Messages that do not have the \Answered flag set.

      UNDELETED
         Messages that do not have the \Deleted flag set.

      UNDRAFT
         Messages that do not have the \Draft flag set.

      UNFLAGGED
         Messages that do not have the \Flagged flag set.

      UNKEYWORD 
         Messages that do not have the specified keyword flag set.

      UNSEEN
         Messages that do not have the \Seen flag set.

Returns Nothing on failure

(Classic ASP) Search IMAP Mailbox for Email Matching Criteria

(Visual FoxPro) Search IMAP Mailbox for Email Matching Criteria

(PowerBuilder) Search IMAP Mailbox for Email Matching Criteria

(SQL Server) Search IMAP Mailbox for Email Matching Criteria

(Visual Basic 6.0) Search IMAP Mailbox for Email Matching Criteria

(VBScript) Search IMAP Mailbox for Email Matching Criteria

SearchAsync(criteria As String, ByVal bUid As Long) As ChilkatTask

Creates an asynchronous task to call the Search method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

(Classic ASP) How to Return an Object from an Async Task

(Visual FoxPro) How to Return an Object from an Async Task

(PowerBuilder) How to Return an Object from an Async Task

(SQL Server) How to Return an Object from an Async Task

(Visual Basic 6.0) How to Return an Object from an Async Task

(VBScript) How to Return an Object from an Async Task

SelectMailbox(mailbox As String) As Long

Selects a mailbox. A mailbox must be selected before some methods, such as Search or FetchSingle, can be called. If the logged-on user does not have write-access to the mailbox, call ExamineMailbox instead.

Calling this method updates the NumMessages property.

Note: The term "mailbox" and "folder" are synonymous. Whenever the word "mailbox" is used, it has the same meaning as "folder".

Returns 1 for success, 0 for failure.

Selecting Public Folders

(Classic ASP) IMAP Get List of Flags

(Visual FoxPro) IMAP Get List of Flags

(PowerBuilder) IMAP Get List of Flags

(SQL Server) IMAP Get List of Flags

(Visual Basic 6.0) IMAP Get List of Flags

(VBScript) IMAP Get List of Flags

SelectMailboxAsync(mailbox As String) As ChilkatTask

Creates an asynchronous task to call the SelectMailbox method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

SendRawCommand(cmd As String) As String

Allows for the sending of arbitrary commands to the IMAP server.

Returns Nothing on failure

(Classic ASP) Move Messages from one Mailbox to Another

(Visual FoxPro) Move Messages from one Mailbox to Another

(PowerBuilder) Move Messages from one Mailbox to Another

(SQL Server) Move Messages from one Mailbox to Another

(Visual Basic 6.0) Move Messages from one Mailbox to Another

(VBScript) Move Messages from one Mailbox to Another

SendRawCommandAsync(cmd As String) As ChilkatTask

Creates an asynchronous task to call the SendRawCommand method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

SendRawCommandB(cmd As String) As Variant

The same as SendRawCommand, but instead of returning the response as a string, the binary bytes of the response are returned.

Returns a zero-length byte array (as a Variant) on failure.
An empty array will have a UBound of -1 meaning 0 elements.

SendRawCommandBAsync(cmd As String) As ChilkatTask

Creates an asynchronous task to call the SendRawCommandB method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

SendRawCommandC(cmd As Variant) As Variant

The same as SendRawCommandB, except that the command is provided as binary bytes rather than a string.

Returns a zero-length byte array (as a Variant) on failure.
An empty array will have a UBound of -1 meaning 0 elements.

SendRawCommandCAsync(cmd As Variant) As ChilkatTask

Creates an asynchronous task to call the SendRawCommandC method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

SetCSP(csp As ChilkatCsp) As Long

(Only applies to the Microsoft Windows OS) Sets the Cryptographic Service Provider (CSP) to be used for encryption or digital signing, or decryption / signature verification.

This is not commonly used becaues the default Microsoft CSP is typically appropriate. One instance where SetCSP is necessary is when using the Crypto-Pro CSP for the GOST R 34.10-2001 and GOST R 34.10-94 providers.

Returns 1 for success, 0 for failure.

SetDecryptCert(cert As ChilkatCert) As Long

Introduced in version 9.5.0.40

Explicitly specifies the certificate to be used for decrypting encrypted email.

Returns 1 for success, 0 for failure.

SetDecryptCert2(cert As ChilkatCert, key As PrivateKey) As Long

Used to explicitly specify the certificate and associated private key to be used for decrypting S/MIME (PKCS7) email.

Returns 1 for success, 0 for failure.

SetFlag(ByVal msgId As Long, ByVal bUid As Long, flagName As String, ByVal value As Long) As Long

Sets a flag for a single message on the IMAP server. If value = 1, the flag is turned on, if value = 0, the flag is turned off. Standard system flags such as "\Deleted", "\Seen", "\Answered", "\Flagged", "\Draft", and "\Answered" may be set. Custom flags such as "NonJunk", "$label1", "$MailFlagBit1", etc. may also be set.

If bUid is 1, then msgId represents a UID. If bUid is 0, then msgId represents a sequence number.

Returns 1 for success, 0 for failure.

SetFlagAsync(ByVal msgId As Long, ByVal bUid As Long, flagName As String, ByVal value As Long) As ChilkatTask

Creates an asynchronous task to call the SetFlag method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

SetFlags(messageSet As MessageSet, flagName As String, ByVal value As Long) As Long

Sets a flag for each message in the message set on the IMAP server. If value = 1, the flag is turned on, if value = 0, the flag is turned off. Standard system flags such as "\Deleted", "\Seen", "\Answered", "\Flagged", "\Draft", and "\Answered" may be set. Custom flags such as "NonJunk", "$label1", "$MailFlagBit1", etc. may also be set.

Returns 1 for success, 0 for failure.

SetFlagsAsync(messageSet As MessageSet, flagName As String, ByVal value As Long) As ChilkatTask

Creates an asynchronous task to call the SetFlags method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

SetMailFlag(email As ChilkatEmail, flagName As String, ByVal value As Long) As Long

Sets a flag for a single message on the IMAP server. The UID of the email object is used to find the message on the IMAP server that is to be affected. If value = 1, the flag is turned on, if value = 0, the flag is turned off.

Both standard system flags as well as custom flags may be set. Standard system flags typically begin with a backslash character, such as "\Deleted", "\Seen", "\Answered", "\Flagged", "\Draft", and "\Answered". Custom flags can be anything, such as "NonJunk", "$label1", "$MailFlagBit1", etc. .

Note: When the Chilkat IMAP component downloads an email from an IMAP server, it inserts a "ckx-imap-uid" header field in the email object. This is subsequently used by this method to get the UID associated with the email. The "ckx-imap-uid" header must be present for this method to be successful.

Note: Calling this method is identical to calling the SetFlag method, except the UID is automatically obtained from the email object.

Important: Setting the "Deleted" flag does not remove the email from the mailbox. Emails marked "Deleted" are removed when the Expunge method is called.

Returns 1 for success, 0 for failure.

SetMailFlagAsync(email As ChilkatEmail, flagName As String, ByVal value As Long) As ChilkatTask

Creates an asynchronous task to call the SetMailFlag method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

SetQuota(quotaRoot As String, resource As String, ByVal quota As Long) As Long

Introduced in version 9.5.0.58

Sets the quota for a quotaRoot. The resource should be one of two keywords:"STORAGE" or "MESSAGE". Use "STORAGE" to set the maximum capacity of the combined messages in quotaRoot. Use "MESSAGE" to set the maximum number of messages allowed.

If setting a STORAGE quota, the quota is in units of 1024 octets. For example, to specify a limit of 500,000,000 bytes, set quota equal to 500,000.

This feature is only possible with IMAP servers that support the QUOTA extension/capability. If an IMAP server supports the QUOTA extension, it likely supports the STORAGE resource. The MESSAGE resource is less commonly supported.

SetQuotaAsync(quotaRoot As String, resource As String, ByVal quota As Long) As ChilkatTask

Introduced in version 9.5.0.58

Creates an asynchronous task to call the SetQuota method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

SetSslClientCert(cert As ChilkatCert) As Long

Specifies a client-side certificate to be used for the SSL / TLS connection. In most cases, servers do not require client-side certificates for SSL/TLS. A client-side certificate is typically used in high-security situations where the certificate is an additional means to indentify the client to the server.

Returns 1 for success, 0 for failure.

SetSslClientCertPem(pemDataOrFilename As String, pemPassword As String) As Long

(Same as SetSslClientCert, but allows a .pfx/.p12 file to be used directly) Specifies a client-side certificate to be used for the SSL / TLS connection. In most cases, servers do not require client-side certificates for SSL/TLS. A client-side certificate is typically used in high-security situations where the certificate is an additional means to indentify the client to the server.

The pemDataOrFilename may contain the actual PEM data, or it may contain the path of the PEM file. This method will automatically recognize whether it is a path or the PEM data itself.

Returns 1 for success, 0 for failure.

How to Create a PEM that Contains Certificates and a Private Key

SetSslClientCertPfx(pfxFilename As String, pfxPassword As String) As Long

(Same as SetSslClientCert, but allows a .pfx/.p12 file to be used directly) Specifies a client-side certificate to be used for the SSL / TLS connection. In most cases, servers do not require client-side certificates for SSL/TLS. A client-side certificate is typically used in high-security situations where the certificate is an additional means to indentify the client to the server.

Returns 1 for success, 0 for failure.

SshAuthenticatePk(sshLogin As String, privateKey As ChilkatSshKey) As Long

Authenticates with the SSH server using public-key authentication. The corresponding public key must have been installed on the SSH server for the sshLogin. Authentication will succeed if the matching privateKey is provided.

Important: When reporting problems, please send the full contents of the LastErrorText property to support@chilkatsoft.com.

Returns 1 for success, 0 for failure.

SshAuthenticatePkAsync(sshLogin As String, privateKey As ChilkatSshKey) As ChilkatTask

Creates an asynchronous task to call the SshAuthenticatePk method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

SshAuthenticatePw(sshLogin As String, sshPassword As String) As Long

Authenticates with the SSH server using a sshLogin and sshPassword.

An SSH tunneling (port forwarding) session always begins by first calling SshTunnel to connect to the SSH server, then calling either AuthenticatePw or AuthenticatePk to authenticate. Following this, your program should call Connect to connect with the IMAP server (via the SSH tunnel) and then Login to authenticate with the IMAP server.

Note: Once the SSH tunnel is setup by calling SshTunnel and SshAuthenticatePw (or SshAuthenticatePk), all underlying communcations with the IMAP server use the SSH tunnel. No changes in programming are required other than making two initial calls to setup the tunnel.

Important: When reporting problems, please send the full contents of the LastErrorText property to support@chilkatsoft.com.

Returns 1 for success, 0 for failure.

(Classic ASP) IMAP SSH Tunneling (Port Forwarding)

(Visual FoxPro) IMAP SSH Tunneling (Port Forwarding)

(PowerBuilder) IMAP SSH Tunneling (Port Forwarding)

(SQL Server) IMAP SSH Tunneling (Port Forwarding)

(Visual Basic 6.0) IMAP SSH Tunneling (Port Forwarding)

(VBScript) IMAP SSH Tunneling (Port Forwarding)

SshAuthenticatePwAsync(sshLogin As String, sshPassword As String) As ChilkatTask

Creates an asynchronous task to call the SshAuthenticatePw method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

SshCloseTunnel() As Long

Introduced in version 9.5.0.50

Closes the SSH tunnel previously opened by SshOpenTunnel.

Returns 1 for success, 0 for failure.

SshCloseTunnelAsync() As ChilkatTask

Introduced in version 9.5.0.50

Creates an asynchronous task to call the SshCloseTunnel method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

SshOpenTunnel(sshHostname As String, ByVal sshPort As Long) As Long

Introduced in version 9.5.0.50

Connects to an SSH server and creates a tunnel for IMAP. The sshHostname is the hostname (or IP address) of the SSH server. The sshPort is typically 22, which is the standard SSH port number.

An SSH tunneling (port forwarding) session always begins by first calling SshOpenTunnel to connect to the SSH server, followed by calling either SshAuthenticatePw or SshAuthenticatePk to authenticate. Your program would then call Connect to connect with the IMAP server (via the SSH tunnel) and then Login to authenticate with the IMAP server.

Note: Once the SSH tunnel is setup by calling SshOpenTunnel and SshAuthenticatePw (or SshAuthenticatePk), all underlying communcations with the IMAP server use the SSH tunnel. No changes in programming are required other than making two initial calls to setup the tunnel.

Important: When reporting problems, please send the full contents of the LastErrorText property to support@chilkatsoft.com.

Returns 1 for success, 0 for failure.

(Classic ASP) IMAP SSH Tunneling (Port Forwarding)

(Visual FoxPro) IMAP SSH Tunneling (Port Forwarding)

(PowerBuilder) IMAP SSH Tunneling (Port Forwarding)

(SQL Server) IMAP SSH Tunneling (Port Forwarding)

(Visual Basic 6.0) IMAP SSH Tunneling (Port Forwarding)

(VBScript) IMAP SSH Tunneling (Port Forwarding)

SshOpenTunnelAsync(sshHostname As String, ByVal sshPort As Long) As ChilkatTask

Introduced in version 9.5.0.50

Creates an asynchronous task to call the SshOpenTunnel method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

StoreFlags(ByVal msgId As Long, ByVal bUid As Long, flagNames As String, ByVal value As Long) As Long

Sets one or more flags to a specific value for an email. The email is indicated by either a UID or sequence number, depending on whether bUid is 1 (UID) or 0 (sequence number).

flagNames should be a space separated string of flag names. Both standard and customer flags may be set. Standard flag names typically begin with a backslash character. For example: "\Seen \Answered". Custom flag names may also be included. Custom flags often begin with a $ character, such as "$label1", or "$MailFlagBit0". Other customer flags may begin with any character, such as "NonJunk".

value should be 1 to turn the flags on, or 0 to turn the flags off.

Returns 1 for success, 0 for failure.

StoreFlagsAsync(ByVal msgId As Long, ByVal bUid As Long, flagNames As String, ByVal value As Long) As ChilkatTask

Creates an asynchronous task to call the StoreFlags method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

Subscribe(mailbox As String) As Long

Subscribe to an IMAP mailbox.

Note: The term "mailbox" and "folder" are synonymous. Whenever the word "mailbox" is used, it has the same meaning as "folder".

Returns 1 for success, 0 for failure.

SubscribeAsync(mailbox As String) As ChilkatTask

Creates an asynchronous task to call the Subscribe method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

UnlockComponent(unlockCode As String) As Long

Unlocks the component. This must be called once at the beginning of your program to unlock the component. A purchased unlock code is provided when the IMAP component is licensed. Any string, such as "Hello World", may be passed to this method to automatically begin a fully-functional 30-day trial.

Returns 1 for success, 0 for failure.

Diagnosing UnlockComponent Problems

UnlockComponent LastErrorText shows exact string passed to it.

Verify UnlockComponent Success w/ Purchased Unlock Code

LastErrorText Standard Information

Unsubscribe(mailbox As String) As Long

Unsubscribe from an IMAP mailbox.

Returns 1 for success, 0 for failure.

UnsubscribeAsync(mailbox As String) As ChilkatTask

Creates an asynchronous task to call the Unsubscribe method with the arguments provided. (Async methods are available starting in Chilkat v9.5.0.52.)

Note: Async method event callbacks happen in the background thread. Accessing and updating UI elements existing in the main thread may require special considerations.

Returns Nothing on failure

VB6 Programs MUST Call FinalizeThreadPool Just Before Exiting

Asynchronous Methods in VB6 - Be Very Careful with Callbacks

(Classic ASP) How to Run an Asynchronous Task

(Visual FoxPro) How to Run an Asynchronous Task

(PowerBuilder) How to Run an Asynchronous Task

(SQL Server) How to Run an Asynchronous Task

(Visual Basic 6.0) How to Run an Asynchronous Task

(VBScript) How to Run an Asynchronous Task

UseCertVault(vault As ChilkatXmlCertVault) As Long

Introduced in version 9.5.0.40

Adds an XML certificate vault to the object's internal list of sources to be searched for certificates and private keys when encrypting/decrypting or signing/verifying. Unlike the AddPfxSourceData and AddPfxSourceFile methods, only a single XML certificate vault can be used. If UseCertVault is called multiple times, only the last certificate vault will be used, as each call to UseCertVault will replace the certificate vault provided in previous calls.

Returns 1 for success, 0 for failure.

UseSsh(ssh As ChilkatSsh) As Long

Introduced in version 9.5.0.55

Uses an existing SSH tunnel for the connection to the IMAP server. This method is identical to the UseSshTunnel method, except the SSH connection is obtained from an SSH object instead of a Socket object.

This is useful for sharing an existing SSH tunnel connection wth other objects. (SSH is a protocol where the tunnel contains many logical channels. IMAP connections can exist simultaneously with other connection within a single SSH tunnel as SSH channels.)

Returns 1 for success, 0 for failure.

(Classic ASP) IMAP over Multiple Hop SSH

(Visual FoxPro) IMAP over Multiple Hop SSH

(PowerBuilder) IMAP over Multiple Hop SSH

(SQL Server) IMAP over Multiple Hop SSH

(Visual Basic 6.0) IMAP over Multiple Hop SSH

(VBScript) IMAP over Multiple Hop SSH

UseSshTunnel(tunnel As ChilkatSocket) As Long

Introduced in version 9.5.0.50

Uses an existing SSH tunnel. This is useful for sharing an existing SSH tunnel connection wth other objects. (SSH is a protocol where the tunnel contains many logical channels. IMAP connections can exist simultaneously with other connection within a single SSH tunnel as SSH channels.)

Returns 1 for success, 0 for failure.

(Classic ASP) IMAP Use Existing SSH Tunnel

(Visual FoxPro) IMAP Use Existing SSH Tunnel

(PowerBuilder) IMAP Use Existing SSH Tunnel

(SQL Server) IMAP Use Existing SSH Tunnel

(Visual Basic 6.0) IMAP Use Existing SSH Tunnel

(VBScript) IMAP Use Existing SSH Tunnel

Events

AbortCheck(abort As Long)

Provides the opportunity for a method call to be aborted. The AbortCheck event is fired periodically based on the value of the HeartbeatMs property. If HeartbeatMs is 0, then no AbortCheck events will fire. As an example, to fire 5 AbortCheck events per second, set the HeartbeatMs property equal to 200.

VB6 Event callback implementation:

Important: Event callbacks from asynchronous method calls are generally not possible from the ActiveX. See VB6 Async Callbacks

Dim WithEvents myImap As ChilkatImap

Private Sub myImap_AbortCheck(abort As Long)

	'Insert application code here.

End Sub

BinaryData(data As Variant)

Binary data provided by certain methods.

VB6 Event callback implementation:

Important: Event callbacks from asynchronous method calls are generally not possible from the ActiveX. See VB6 Async Callbacks

Dim WithEvents myImap As ChilkatImap

Private Sub myImap_BinaryData(data As Variant)

	'Insert application code here.

End Sub

PercentDone(ByVal pctDone As Long, abort As Long)

Provides the percentage completed for any method that involves network communications or time-consuming processing (assuming it is a method where a percentage completion can be measured). This event is only fired when it is possible to know a percentage completion, and when it makes sense to express the operation as a percentage completed. The pctDone argument will have a value from 1 to 100. For operations (Chilkat method calls) that complete very quickly, the number of PercentDone callbacks will vary, but the final callback should have a value of 100. For long running operations, no more than one callback per percentage point will occur (for example: 1, 2, 3, ... 98, 99, 100).

The PercentDone callback counts as an AbortCheck event. For method calls that complete quickly such that PercentDone events fire, it may be that AbortCheck events don't fire because the opportunity to abort is already provided in the PercentDone callback. For time consuming operations, where the amount of time between PercentDone callbacks are long, AbortCheck callbacks may be used to allow for the operation to be aborted in a more responsive manner.

The abort output argument provides a means for aborting the operation. Setting it to 1 will cause the method to abort and return a failed status (or whatever return value indicates failure).

VB6 Event callback implementation:

Important: Event callbacks from asynchronous method calls are generally not possible from the ActiveX. See VB6 Async Callbacks

Dim WithEvents myImap As ChilkatImap

Private Sub myImap_PercentDone(ByVal pctDone As Long, abort As Long)

	'Insert application code here.

End Sub

ProgressInfo(name As String, value As String)

A general name/value event that provides information about what is happening during a method call. To find out what information is available, write code to handle this event and log the name/value pairs. Most are self-explanatory.

VB6 Event callback implementation:

Important: Event callbacks from asynchronous method calls are generally not possible from the ActiveX. See VB6 Async Callbacks

Dim WithEvents myImap As ChilkatImap

Private Sub myImap_ProgressInfo(name As String, value As String)

	'Insert application code here.

End Sub

TextData(data As String)

Text data provided by certain methods.

VB6 Event callback implementation:

Important: Event callbacks from asynchronous method calls are generally not possible from the ActiveX. See VB6 Async Callbacks

Dim WithEvents myImap As ChilkatImap

Private Sub myImap_TextData(data As String)

	'Insert application code here.

End Sub