Sample code for 30+ languages & platforms
Tcl

Transition from Imap.FetchSingle to Imap.FetchEmail

Provides instructions for replacing deprecated FetchSingle method calls with FetchEmail.

Chilkat Tcl Downloads

Tcl

load ./chilkat.dll

set success 0

set imap [new_CkImap]

# ...
# ...

# ------------------------------------------------------------------------
# The FetchSingle method is deprecated:

# emailObj is a CkEmail
set emailObj [CkImap_FetchSingle $imap 1 0]
if {[CkImap_get_LastMethodSuccess $imap] == 0} then {
    puts [CkImap_lastErrorText $imap]
    delete_CkImap $imap
    exit
}

# ...
# ...

delete_CkEmail $emailObj

# ------------------------------------------------------------------------
# Do the equivalent using FetchEmail.
# Your application creates a new, empty Email object which is passed 
# in the last argument and filled upon success.

set headerOnly 0

set email [new_CkEmail]

set success [CkImap_FetchEmail $imap $headerOnly 1 0 $email]
if {$success == 0} then {
    puts [CkImap_lastErrorText $imap]
    delete_CkImap $imap
    delete_CkEmail $email
    exit
}


delete_CkImap $imap
delete_CkEmail $email