Sample code for 30+ languages & platforms
Ruby

Transition from Imap.FetchBundle to Imap.FetchMsgSet

Provides instructions for replacing deprecated FetchBundle method calls with FetchMsgSet.

Chilkat Ruby Downloads

Ruby
require 'chilkat'

success = false

imap = Chilkat::CkImap.new()

# ...
# ...

mset = Chilkat::CkMessageSet.new()
success = imap.QueryMbx("FROM joe@example.com",true,mset)
# ...
# ...

# ------------------------------------------------------------------------
# The FetchBundle method is deprecated:

# bundleObj is a CkEmailBundle
bundleObj = imap.FetchBundle(mset)
if (imap.get_LastMethodSuccess() == false)
    print imap.lastErrorText() + "\n";
    exit
end

# ...
# ...

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

headersOnly = false

bundleOut = Chilkat::CkEmailBundle.new()
success = imap.FetchMsgSet(headersOnly,mset,bundleOut)
if (success == false)
    print imap.lastErrorText() + "\n";
    exit
end