none
Exchange 2010 (no service pack) Eml body of email is present in file but empty in outlook RRS feed

  • Question

  • We use an exchange agent to save some of the send emails to disk. However the exchange againt writes an (html-)email to disk that cannot be opened by outlook correctly.

    Everything is in the file we presume judging by the contents when inspecting it with notepad++. However when we open the file in outlook it opens loads all the info of the email except the body of the email itself. Attachments in the email are shown.

    We tried some changes to the sending process. When changed to rtf and plaintext there are no problems opening the file. However this is a undiserable solution.

    Therefore we send the same email in the 3 formats available in outlook 2010: plaintext,rtf and the not working html format. All three files are nearly identical except the obvious differences noted below.

    Differences:

    • Time send
    • Original Size
    • Message-ID
    • TNEF-Correlator
    • The Winmail.dat attachment(this part contains the body of the email)

    For an html email send with an attachment the attachment is recognized by outlook showing that the winmail.dat is readable.
    However the body is not readable.

    We tried to force Exchange to use the rich-text format, without any effect on the emails.

    The piece of code writes the email to disk before encrypting it:

    using (var ms = mailItem.GetMimeReadStream()) 
    {
      using (var fs = new  
      FileStream(@"c:\temp\email.eml",FileMode.Create))                            
      {                        
        Write(ms, fs);                    
      }                
    }  

    In this piece of code below we open the email after it is encrypted. The code is highly shortened.

    Code:

    var result = binaryFormatter.Deserialize(memoryStream) as ExtractedEmailInfo; //At this point we have read the file and decrypted it
    result.Body ; //has a value and is filled with the correct emailbody

    The result of the code suggests that the file has no problems of its own, but it's merely outlook not working as intended.

    Any suggestions as to look where the problem might be and what possible solutions there are to fixing the problem?



    Monday, June 29, 2015 3:00 PM