Sample code for 30+ languages & platforms
PHP ActiveX

Transition from Imap.FetchSingleHeader to Imap.FetchEmail

Provides instructions for replacing deprecated FetchSingleHeader method calls with FetchEmail.

Chilkat PHP ActiveX Downloads

PHP ActiveX
<?php

$success = 0;

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

// ...
// ...

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

// emailObj is a Chilkat.Email
$emailObj = $imap->FetchSingleHeader(1,0);
if ($imap->LastMethodSuccess == 0) {
    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 = 1;

$emailOut = new COM("Chilkat.Email");
$success = $imap->FetchEmail($headerOnly,1,0,$emailOut);
if ($success == 0) {
    print $imap->LastErrorText . "\n";
    exit;
}


?>