case 'text/html': if (!empty($obj->disposition)AND $obj->disposition == 'attachment') { $names = split(';', $obj->headers["content-disposition"]); $names = split('=', $names[1]); $aux['name'] = $names[1]; $aux['content-type'] = $obj->headers["content-type"]; $aux['part'] = $i; $parts['attachments'][] = $aux; } else { $parts['html'][] = $obj->body; } break; default: $names = split(';', $obj->headers["content-disposition"]); $names = split('=', $names[1]); $aux['name'] = $names[1]; $aux['content-type'] = $obj->headers["content-type"]; $aux['part'] = $i; $parts['attachments'][] = $aux; } } }