mailparse_msg_get_part
(PHP 4 >= 4.0.7, PECL mailparse:0.9-2.1.1)
mailparse_msg_get_part — Returns a handle on a given section in a mimemessage
Описание
resource mailparse_msg_get_part
( resource $mimemail
, string $mimesection
)
Внимание
К настоящему времени эта функция еще не была документирована; для ознакомления доступен только список аргументов.
Список параметров
- mimemail
-
A valid MIME resource.
- mimesection
-
- PHP Руководство
- Функции по категориям
- Индекс функций
- Справочник функций
- Расширения для работы с почтой
- Mailparse
- mailparse_determine_best_xfer_encoding
- mailparse_msg_create
- mailparse_msg_extract_part_file
- mailparse_msg_extract_part
- mailparse_msg_extract_whole_part_file
- mailparse_msg_free
- mailparse_msg_get_part_data
- mailparse_msg_get_part
- mailparse_msg_get_structure
- mailparse_msg_parse_file
- mailparse_msg_parse
- mailparse_rfc822_parse_addresses
- mailparse_stream_encode
- mailparse_uudecode_all
Коментарии
A multi-part e-mail message can exists out of different parts.
Like:
Array
(
[0] => 1
[1] => 1.1
[2] => 1.1.1
[3] => 1.1.2
[4] => 1.2
)
Each part is a section in the mail message. To loop through every part of the message you need to go like this:
$mime_part = mailparse_msg_get_part($this->message, "1.2"); //1.2 is the binary base64 encoded part of the attachement
$body_parts = mailparse_msg_get_part_data($mime_part);
Body part looks like this:
Array
(
[headers] => Array
(
[content-type] => application/x-zip-compressed; name="3000_000000.txt"
[content-disposition] => attachment; filename="3000_000000.txt"
[content-transfer-encoding] => base64
[x-attachment-id] => b31f1a24358e7e5_0.1
)
[starting-pos] => 4513
[starting-pos-body] => 4736
[ending-pos] => 4772
[ending-pos-body] => 4772
[line-count] => 6
[body-line-count] => 0
[charset] => us-ascii
[transfer-encoding] => base64
[content-name] => 3000_000000.sbd
[content-type] => application/x-zip-compressed
[disposition-filename] => 3000_000000.sbd
[content-disposition] => attachment
[content-base] => /
)