(Ruby) Transition from Imap.FetchSingle to Imap.FetchEmail
Provides instructions for replacing deprecated FetchSingle method calls with FetchEmail. Note: This example requires Chilkat v11.0.0 or greater.
require 'chilkat'
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
|