You are here

function mimemail_parse_boundary in Mime Mail 6

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

File

./mimemail.inc, line 503
Common mail functions for sending e-mail. Originally written by Gerhard.

Code

function mimemail_parse_boundary($part) {
  $m = array();
  if (preg_match('/.*boundary="?([^";]+)"?.*/', $part['headers']['Content-Type'], $m)) {
    $boundary = "\n--" . $m[1];
    $body = str_replace("{$boundary}--", '', $part['body']);
    return array_slice(explode($boundary, $body), 1);
  }
  return array(
    $part['body'],
  );
}