(Perl) Transition from Imap.FetchSingleHeader to Imap.FetchEmail
Provides instructions for replacing deprecated FetchSingleHeader method calls with FetchEmail. Note: This example requires Chilkat v11.0.0 or greater.
use chilkat();
$imap = chilkat::CkImap->new();
# ...
# ...
# ------------------------------------------------------------------------
# The FetchSingleHeader method is deprecated:
# emailObj is a Email
$emailObj = $imap->FetchSingleHeader(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 = 1;
$emailOut = chilkat::CkEmail->new();
$success = $imap->FetchEmail($headerOnly,1,0,$emailOut);
if ($success == 0) {
print $imap->lastErrorText() . "\r\n";
exit;
}
|