Sample code for 30+ languages & platforms
Perl

Transition from Imap.FetchBundleAsMime to Imap.FetchSingleBd

Provides instructions for replacing deprecated FetchBundleAsMime method calls with FetchSingleBd.

Chilkat Perl Downloads

Perl
use chilkat();

$success = 0;

$imap = chilkat::CkImap->new();

# ...
# ...

$mset = chilkat::CkMessageSet->new();
$success = $imap->QueryMbx('FROM joe@example.com',1,$mset);
# ...
# ...

# ------------------------------------------------------------------------
# The FetchBundleAsMime method is deprecated:

# saObj is a StringArray
$saObj = $imap->FetchBundleAsMime($mset);
if ($imap->get_LastMethodSuccess() == 0) {
    print $imap->lastErrorText() . "\r\n";
    exit;
}

# ...
# ...

# ------------------------------------------------------------------------
# Do the equivalent using FetchSingleBd.

$imap->put_AutoDownloadAttachments(1);

$bdMime = chilkat::CkBinData->new();
$bUid = $mset->get_HasUids();
$numEmails = $mset->get_Count();
$i = 0;
while ($i < $numEmails) {
    $success = $imap->FetchSingleBd($mset->GetId($i),$bUid,$bdMime);
    # ...
    # ...

    $i = $i + 1;
}