How detect/check if message body is tnef format (winmail.dat) using PHP?
I don't want to decode, just want to check. I using imap_fetchbody
and imap_body
for get BODY, I need get mimetype (or like) for check if is "tnef format", like this:
if (in_array($bodyMimeType, array('application/tnef', 'application/x-tnef', 'application/ms-tnef'))) {
//Decode
}
I tried:
$structure = imap_fetchstructure($imap, $messageId, FT_UID);
echo 'sub-type:', $structure->subtype, PHP_EOL;
echo 'encoding:', $structure->encoding, PHP_EOL;