Sample code for 30+ languages & platforms
Ruby

Transition from Imap.FetchSingle to Imap.FetchEmail

Provides instructions for replacing deprecated FetchSingle method calls with FetchEmail.

Chilkat Ruby Downloads

Ruby
require 'chilkat'

success = false

imap = Chilkat::CkImap.new()

# ...
# ...

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

# emailObj is a CkEmail
emailObj = imap.FetchSingle(1,false)
if (imap.get_LastMethodSuccess() == false)
    print imap.lastErrorText() + "\n";
    exit
end

# ...
# ...

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

headerOnly = false

email = Chilkat::CkEmail.new()
success = imap.FetchEmail(headerOnly,1,false,email)
if (success == false)
    print imap.lastErrorText() + "\n";
    exit
end