" . print_r($part_data, true) . "\n"; break; case 'multipart/signed': echo "
" . print_r($part_data, true) . "
\n"; break; case 'application/zip': $name = $part_data['disposition-filename'] ?? $part_data['content-name'] ?? 'unknown.zip'; $contents = mailparse_msg_extract_part($part, $buffer, null); // null for returning content break; case 'text/plain': $body = mailparse_msg_extract_part($part, $buffer, null); echo " CHARSET " . $part_data['charset'] . "\n"; echo " BODY " . substr($body, 0, 600) . "\n"; break; default: echo $part_data['content-type'] . "\n"; echo "name " . $part_data['content-name'] . "\n"; echo "
" . print_r(array_keys($part_data), true) . "
\n"; break; } } /* foreach($struct as $st) { $section = mailparse_msg_get_part($mp, $st); $info = mailparse_msg_get_part_data($section); // print_r($info); echo "Content Type: " . $info['content-type'] . "\n"; switch ($info['content-type']) { case 'text/plain': $body = ''; $part = mailparse_msg_extract_part($section, $body, null); echo "BODY
" . print_r($body, true) . "
\n"; echo "PART
" . print_r($part, true) . "
\n"; break; } } */ mailparse_msg_free($mp);