Sample code for 30+ languages & platforms
PHP Extension

Transition from Imap.FetchSingleHeader to Imap.FetchEmail

Provides instructions for replacing deprecated FetchSingleHeader method calls with FetchEmail.

Chilkat PHP Extension Downloads

PHP Extension
<?php

include("chilkat.php");

$success = false;

$imap = new CkImap();

// ...
// ...

// ------------------------------------------------------------------------
// The FetchSingleHeader method is deprecated:

// emailObj is a CkEmail
$emailObj = $imap->FetchSingleHeader(1,false);
if ($imap->get_LastMethodSuccess() == false) {
    print $imap->lastErrorText() . "\n";
    exit;
}

// ...
// ...

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

$headerOnly = true;

$emailOut = new CkEmail();
$success = $imap->FetchEmail($headerOnly,1,false,$emailOut);
if ($success == false) {
    print $imap->lastErrorText() . "\n";
    exit;
}


?>