function mailhandler_get_mime_type in Mailhandler 7
Same name and namespace in other branches
- 5 mailhandler.module \mailhandler_get_mime_type()
- 6 mailhandler.retrieve.inc \mailhandler_get_mime_type()
Retrieve MIME type of the message structure.
2 calls to mailhandler_get_mime_type()
- mailhandler_get_part in ./
mailhandler.retrieve.inc - Returns the first part with the specified mime_type
- mailhandler_get_parts in ./
mailhandler.retrieve.inc - Returns an array of parts as file objects
File
- ./
mailhandler.retrieve.inc, line 193
Code
function mailhandler_get_mime_type(&$structure) {
static $primary_mime_type = array(
'TEXT',
'MULTIPART',
'MESSAGE',
'APPLICATION',
'AUDIO',
'IMAGE',
'VIDEO',
'OTHER',
);
$type_id = (int) $structure->type;
if (isset($primary_mime_type[$type_id]) && !empty($structure->subtype)) {
return $primary_mime_type[$type_id] . '/' . $structure->subtype;
}
return 'TEXT/PLAIN';
}