电子邮件中 ​​.eml 文件的 MIME 类型是什么

What is the MIME type of .eml files in emails

我想将 MTA 报告(未投递的退回邮件)附加到电子邮件,但正确的 MIME 类型是什么?

我使用

获取 MTA 报告的完整正文
$body = imap_fetchbody($this->Mailbox->stream, $this->header->uid, '', FT_UID);

但是附加的 .eml 文件的正确 MIME 类型是什么?

已尝试 message/rfc822 但是当您在 Thunderbird 中打开文件时,弹出窗口 windows 是空的。也试过 text/plain 但随后附件以纯文本形式打开。我想打开附件 .eml 作为电子邮件

当您收到 MTA 报告(未送达)时,退回邮件始终作为附件转发

我想将完整的 MTA 报告 + 转发的退回邮件附加到新邮件中

根据截至 2020-12-23 的列表,没有适合它的 mime 类型。参见:

http://www.iana.org/assignments/media-types/media-types.xhtml

Content-Type: application/octet-stream 应该可以解决问题。


我们的(专有)邮件客户端在工作中刚刚设置 Content-Type: application/octet-stream; name="xxx.EML" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="xxx.EML",并且能够通过双击再次将收到的附件“作为”电子邮件打开。由于该 MIME 类型不是特定的,我想它会回到为 OS 级别上的 .eml 后缀注册的文件类型处理程序。

message/rfc822 ("encapsulated message") 有效,至少对于 ReactDropzone 是这样。该字符串是在删除 .eml 文件时报告为 Type 的内容。 (YMMV。)