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

Transition from Imap.FetchSequenceHeaders to Imap.FetchRange

Provides instructions for replacing deprecated FetchSequenceHeaders method calls with FetchRange.

Chilkat PHP ActiveX Downloads

PHP ActiveX
<?php

$success = 0;

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

//  ...
//  ...

$startSeqNum = 1;
$count = 5;

//  ------------------------------------------------------------------------
//  The FetchSequenceHeaders method is deprecated:

// bundleObj is a Chilkat.EmailBundle
$bundleObj = $imap->FetchSequenceHeaders($startSeqNum,$count);
if ($imap->LastMethodSuccess == 0) {
    print $imap->LastErrorText . "\n";
    exit;
}

//  ...
//  ...

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

$headersOnly = 1;

$bundleOut = new COM("Chilkat.EmailBundle");
$success = $imap->FetchRange($headersOnly,$startSeqNum,$count,$bundleOut);
if ($success == 0) {
    print $imap->LastErrorText . "\n";
    exit;
}


?>