I need to write a program that read the .eml
files from IIS's mail drop box, but I can't find a definitive source that tells me the encoding of the .eml
files. Is there a specification somewhere that tells me the encoding of the files, or do I just have to guess/assume one?
Asked
Active
Viewed 5,802 times
0

Kev
- 118,037
- 53
- 300
- 385

Mike Comstock
- 6,640
- 10
- 36
- 41
-
I think I found my answer at http://en.wikipedia.org/wiki/MIME: "The basic Internet e-mail transmission protocol, SMTP, supports only 7-bit ASCII characters... " – Mike Comstock Nov 17 '09 at 17:25
-
Why don't you add an answer? You won't be able to get rep points but that doesn't matter too much. – ChaosPandion Nov 17 '09 at 17:51
-
I hesitate to add it an an answer because I'm not sure if I'm correct :) – Mike Comstock Nov 19 '09 at 18:08
3 Answers
2
You need to read the Content-Transfer-Encoding header. This value will tell you how the email is encoded. The most common are 7-Bit (no encoding), Quoted-Printable (where you see a lot of =HEX pairs), and base64 (which is base 64 encoding).
Based upon that header value, you decode the following body part using the specified routine.

dave wanta
- 7,164
- 3
- 29
- 29
-
Thanks Dave. The problem is reading the header itself. Can I assume that the headers are ACII characters? – Mike Comstock Nov 19 '09 at 18:08
-
Thank you for mentioning the name "Quoted-Printable." I don't think I'd find it in a reasonable amount of time with your answer here. – Achilles Jun 23 '20 at 23:19
1
Though it's too late to answer but eml file format nothing but a plaintext MIME (rfc822) file format for storing emails.

irsis
- 952
- 1
- 13
- 33
1
I found my answer at en.wikipedia.org/wiki/MIME: "The basic Internet e-mail transmission protocol, SMTP, supports only 7-bit ASCII characters... "

Mike Comstock
- 6,640
- 10
- 36
- 41