How to preserve the formating of contents of eml when storing in string?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sanchaita
    New Member
    • Jan 2011
    • 3

    How to preserve the formating of contents of eml when storing in string?

    Hi

    I am reading a mail stored as eml in a file .I am reading it byte by byte.The code i am using is


    byte[] bytes = File.ReadAllByt es(EmlPath);
    String msg = System.Text.Enc oding.GetEncodi ng("utf-8").GetString(b ytes);

    Here the EmlPath is the path of the eml.The issue is while reading the eml and storing it in a string i.e msg I am losing the formating.small boxes appear wherever there are spaces in the string.How do i resolve this issue.Please help me.Thanx in advance



    Regards
    Sanchaita sujit Chakraborty
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    EML is stored using the MIME format. To correctly decode the EML, you will have to either find a library/api that will do the decoding for you, or implement it yourself. If you're going to decode it yourself, you will have to read the 6 RFC memoranda that lays out the specification for it. You can find the links to those memoranda here: http://en.wikipedia.org/wiki/MIME#Introduction.

    Comment

    Working...