CkPhp Requires Chilkat v11.0.0+
CkPhp
List message headers in their original field order
See more Email Object Examples
Walk the top-level header fields by index. Read the name and value at the same index so repeated fields such as Received retain their separate values. Attachment headers belong to the attachmentâs MIME part.
Chilkat CkPhp Downloads
<?php
include("chilkat.php");
$success = false;
// Assumes Chilkat is unlocked. See Global Unlock Sample.
$email = new CkEmail();
$success = $email->LoadEml('message.eml');
if ($success != true) {
print $email->lastErrorText() . "\n";
exit;
}
$i = 0;
while (($i < $email->get_NumHeaderFields())) {
// Read the value by index because names can repeat.
print $email->getHeaderFieldName($i) . ': ' . $email->getHeaderFieldValue($i) . "\n";
$i = $i + 1;
}
?>