Sample code for 30+ languages & platforms
PHP Extension

Transition from MailMan.TransferMultipleMime to MailMan.FetchMimeBd

Provides instructions for replacing deprecated TransferMultipleMime method calls with FetchMimeBd.

Chilkat PHP Extension Downloads

PHP Extension
<?php

include("chilkat.php");

$success = false;

$mailman = new CkMailMan();

// ...
// ...

$saUidls = new CkStringArray();
$saUidls->Append('aaa');
$saUidls->Append('bbb');
$saUidls->Append('ccc');

$stUidls = new CkStringTable();
$stUidls->Append('aaa');
$stUidls->Append('bbb');
$stUidls->Append('ccc');

// ------------------------------------------------------------------------
// The TransferMultipleMime method is deprecated:

// sa is a CkStringArray
$sa = $mailman->TransferMultipleMime($saUidls);
if ($mailman->get_LastMethodSuccess() == false) {
    print $mailman->lastErrorText() . "\n";
    exit;
}

// ...
// ...

// ------------------------------------------------------------------------
// Do the equivalent using FetchMimeBd.

$mailman->put_ImmediateDelete(false);

$success = false;
$bdMime = new CkBinData();
$numUidls = $stUidls->get_Count();
$i = 0;
while ($i < $numUidls) {
    $success = $mailman->FetchMimeBd($stUidls->stringAt($i),$bdMime);
    // ...

    // Mark the email for deletion.
    $success = $mailman->DeleteByUidl($stUidls->stringAt($i));
    // ...

    $i = $i + 1;
}

// emails marked for deletion will be deleted at this time
$success = $mailman->Pop3EndSession();

?>