我能够使用以下 API 调用获取带有附件的邮件对象
https://graph.microsoft.com/v1.0/me/messages/${messageId}?$expand=attachments
我需要为.eml
将上传到我们内部 CRM 的邮件(即)保存原始 MIME。
我知道可以.eml
以以下方式制作一个简单的文件,但我想知道是否有更简单的替代方法可以直接从 API 获取它。
To: Demo-Recipient <demo@demo.example.com>
Subject: EML with attachments
X-Unsent: 0
Content-Type: multipart/mixed; boundary=--boundary_text_string
----boundary_text_string
Content-Type: text/html; charset=UTF-8
<html>
<body>
<p>Example</p>
</body>
</html>
----boundary_text_string
Content-Type: application/octet-stream; name=demo.txt
Content-Transfer-Encoding: base64
Content-Disposition: attachment
ZXhhbXBsZQ==
----boundary_text_string
Content-Type: application/octet-stream; name=demo.log
Content-Transfer-Encoding: base64
Content-Disposition: attachment
ZXhhbXBsZQ==
----boundary_text_string--