任何人都可以解释如何加密具有多个附件的mime邮件,可读取Outlook?我目前正在构建一个由Outlook正确读取的多部分邮件,但如果我使用openssl_pkcs7_encrypt()加密该multipart-header主体,则Outlook仅读取(html)-body并且无法分离附件 . 然后它说第一个附件是不可读的 .
结构是
To: you@example.com
From: me@example.com
Reply-To: me@example.com
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="mx-2041315b16859f651fe7575c5949d1aa"
This is a multi-part message in MIME format
--mx-2041315b16859f651fe7575c5949d1aa
Content-Type: multipart/related; boundary="rel-2041315b16859f651fe7575c5949d1aa";
--rel-2041315b16859f651fe7575c5949d1aa
Content-Type: text/html; charset=UTF-8;
[html-content here...]
--rel-2041315b16859f651fe7575c5949d1aa
Content-Type: image/jpg; name="Image.jpg"
Content-ID: img1
Content-Disposition: inline; filename="Image.jpg"
Content-Transfer-Encoding: base64
[related base64-encoded JPEG...]
--rel-2041315b16859f651fe7575c5949d1aa
--mx-2041315b16859f651fe7575c5949d1aa
Content-Type: application/octet-stream; name="A_PDF.pdf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="A_PDF.pdf"
[base64-encoded PDF...]
--mx-2041315b16859f651fe7575c5949d1aa