phpemailmime-typesmta

What is the MIME type of .eml files in emails


I want to attach a MTA report (not delivered bounce mail) to an email, but what is the correct MIME type?

I fetch the full body of the MTA report with

$body = imap_fetchbody($this->Mailbox->stream, $this->header->uid, '', FT_UID);

But what is the correct MIME type for attached .eml files?

Have tried message/rfc822 but when you open the file in Thunderbird the popup windows is empty. Have also tried text/plain but then the attachment is opended as plain text. I want to open the attachment .eml as an email

When you receive a MTA report (not delivered) the bounce mail is always forwarded as an attachment

I want to attach the full MTA report + forwarded bounce mail to a new mail


Solution

  • Content-Type: application/octet-stream should do the trick.


    Our (proprietary) mail client at work just sets Content-Type: application/octet-stream; name="xxx.EML" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="xxx.EML", and is able to open the received attachment “as” an email again via double click. Since that mime type is anything but specific, I suppose it falls back onto the file type handler registered for the .eml suffix on the OS level.