(Perl) 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.
use chilkat();
$imap = chilkat::CkImap->new();
# ...
# ...
# ------------------------------------------------------------------------
# The FetchSingle method is deprecated:
# emailObj is a Email
$emailObj = $imap->FetchSingle(1,0);
if ($imap->get_LastMethodSuccess() == 0) {
print $imap->lastErrorText() . "\r\n";
exit;
}
# ...
# ...
# ------------------------------------------------------------------------
# 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 = 0;
$email = chilkat::CkEmail->new();
$success = $imap->FetchEmail($headerOnly,1,0,$email);
if ($success == 0) {
print $imap->lastErrorText() . "\r\n";
exit;
}
|