mailparse_msg_get_part

(PECL mailparse >= 0.9.0)

mailparse_msg_get_part返回 mimemessage 中指定部分的句柄

描述

mailparse_msg_get_part(resource $mimemail, string $mimesection): resource
警告

此函数目前未记录;仅提供其参数列表。

参数

mimemail

有效的 MIME 资源。

mimesection

添加注释

用户贡献的注释 1 个注释

vangelier at hotmail dot com
8 年前
多部分电子邮件消息可以包含不同的部分。

例如

数组
(
[0] => 1
[1] => 1.1
[2] => 1.1.1
[3] => 1.1.2
[4] => 1.2
)

每个部分都是邮件消息中的一个部分。要循环遍历消息的每个部分,您需要执行以下操作

$mime_part = mailparse_msg_get_part($this->message, "1.2"); // 1.2 是附件的二进制 base64 编码部分

$body_parts = mailparse_msg_get_part_data($mime_part);

主体部分如下所示

数组
(
[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] => /
)
To Top