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

Transition from Imap.FetchHeaders to Imap.FetchMsgSet

Provides instructions for replacing deprecated FetchHeaders method calls with FetchMsgSet.

Chilkat PHP Extension Downloads

PHP Extension
<?php

include("chilkat.php");

$success = false;

$imap = new CkImap();

//  ...
//  ...

$mset = new CkMessageSet();
$success = $imap->QueryMbx('FROM joe@example.com',true,$mset);
//  ...
//  ...

//  ------------------------------------------------------------------------
//  The FetchHeaders method is deprecated:

// bundleObj is a CkEmailBundle
$bundleObj = $imap->FetchHeaders($mset);
if ($imap->get_LastMethodSuccess() == false) {
    print $imap->lastErrorText() . "\n";
    exit;
}

//  ...
//  ...

//  ------------------------------------------------------------------------
//  Do the equivalent using FetchMsgSet.
//  Your application creates a new, empty EmailBundle object which is passed 
//  in the last argument and filled upon success.

$headersOnly = true;

$bundleOut = new CkEmailBundle();
$success = $imap->FetchMsgSet($headersOnly,$mset,$bundleOut);
if ($success == false) {
    print $imap->lastErrorText() . "\n";
    exit;
}


?>