Sample code for 30+ languages & platforms
PHP ActiveX Requires Chilkat v11.0.0+

Transition from Imap.FetchBundleAsMime to Imap.FetchSingleBd

Provides instructions for replacing deprecated FetchBundleAsMime method calls with FetchSingleBd.

Chilkat PHP ActiveX Downloads

PHP ActiveX
<?php

$success = 0;

$imap = new COM("Chilkat.Imap");

//  ...
//  ...

$mset = new COM("Chilkat.MessageSet");
$success = $imap->QueryMbx('FROM joe@example.com',1,$mset);
//  ...
//  ...

//  ------------------------------------------------------------------------
//  The FetchBundleAsMime method is deprecated:

// saObj is a Chilkat.StringArray
$saObj = $imap->FetchBundleAsMime($mset);
if ($imap->LastMethodSuccess == 0) {
    print $imap->LastErrorText . "\n";
    exit;
}

//  ...
//  ...

//  ------------------------------------------------------------------------
//  Do the equivalent using FetchSingleBd.

$imap->AutoDownloadAttachments = 1;

$bdMime = new COM("Chilkat.BinData");
$bUid = $mset->HasUids;
$numEmails = $mset->Count;
$i = 0;
while ($i < $numEmails) {
    $success = $imap->FetchSingleBd($mset->GetId($i),$bUid,$bdMime);
    //  ...
    //  ...

    $i = $i + 1;
}


?>