PHP Extension
PHP Extension
Transition from Imap.FetchSingle to Imap.FetchEmail
Provides instructions for replacing deprecated FetchSingle method calls with FetchEmail.Chilkat PHP Extension Downloads
<?php
include("chilkat.php");
$success = false;
$imap = new CkImap();
// ...
// ...
// ------------------------------------------------------------------------
// The FetchSingle method is deprecated:
// emailObj is a CkEmail
$emailObj = $imap->FetchSingle(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 = false;
$email = new CkEmail();
$success = $imap->FetchEmail($headerOnly,1,false,$email);
if ($success == false) {
print $imap->lastErrorText() . "\n";
exit;
}
?>