You are here

function mimemail_parse_attachment in Mime Mail 5

Same name and namespace in other branches
  1. 6 mimemail.inc \mimemail_parse_attachment()
  2. 7 includes/mimemail.incoming.inc \mimemail_parse_attachment()
1 call to mimemail_parse_attachment()
mimemail_parse in ./mimemail.inc

File

./mimemail.inc, line 471

Code

function mimemail_parse_attachment($part) {
  $m = array();
  if (preg_match('/.*filename="?([^";])"?.*/', $part['headers']['Content-Disposition'], $m)) {
    $name = $m[1];
  }
  elseif (preg_match('/.*name="?([^";])"?.*/', $part['headers']['Content-Type'], $m)) {
    $name = $m[1];
  }
  return array(
    'filename' => $name,
    'filemime' => $part['content-type'],
    'content' => mimemail_parse_content($part),
  );
}