| Author |  | 
      
        | vrhovrho Newbie
 
  
 
 Joined: 14 October 2019
 Online Status: Offline
 Posts: 5
 | 
          Hi,
           | Posted: 14 October 2019 at 12:50am | IP Logged |   |  
           | 
 |  
 I have a parent.msg file that contains  child.msg file. When I extract parent.msg file I get the child.eml attachment, which is wrong. I should get child.msg file instead.
 
 var msgConvert = new MailBee.Outlook.MsgConvert();
 msg = msgConvert.MsgToMailMessage(stream);
 msg.Attachments[1].Filename;  //child.eml
 msg.Attachments[1].FilenameOriginal;  //child.eml
 
 Could you please help me?
 
 
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Igor AfterLogic Support
 
  
 
 Joined: 24 June 2008
 Location: United States
 Online Status: Offline
 Posts: 6168
 | 
          That's a by-design behavior. If you convert .MSG to .EML, all the .MSG files within it will be converted as well.
           | Posted: 14 October 2019 at 1:41am | IP Logged |   |  
           | 
 |  
 --
 Regards,
 Igor, Afterlogic Support
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | vrhovrho Newbie
 
  
 
 Joined: 14 October 2019
 Online Status: Offline
 Posts: 5
 | 
          Thank you for your answer. It makes sense.
           | Posted: 15 October 2019 at 10:47pm | IP Logged |   |  
           | 
 |  
 Is there another way to extract files from .MSG file without converting it to .EML?
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Igor AfterLogic Support
 
  
 
 Joined: 24 June 2008
 Location: United States
 Online Status: Offline
 Posts: 6168
 | 
          No, that's the only approach currently available.
           | Posted: 16 October 2019 at 1:05am | IP Logged |   |  
           | 
 |  
 --
 Regards,
 Igor, Afterlogic Support
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | vrhovrho Newbie
 
  
 
 Joined: 14 October 2019
 Online Status: Offline
 Posts: 5
 | 
          Thank you for your answer. Is it possible that you extend the MsgToMailMessage that it doesn't  convert the attached .MSG files to .EML.
           | Posted: 16 October 2019 at 4:06am | IP Logged |   |  
           | 
 |  | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Alex AfterLogic Support
 
  
  
 Joined: 19 November 2003
 Online Status: Offline
 Posts: 2207
 | 
          It actually does not convert anything. There are no MSG attachments in MSG. There are some data structures from which the MSG parser can try to build EML (or MSG). Our parser is able to build EML from these structures.
           | Posted: 16 October 2019 at 4:35am | IP Logged |   |  
           | 
 |  
 If you need MSG, you can then use MailMessageToMsg to convert that EML attachments into MSGs.
 
 Regards,
 Alex
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | vrhovrho Newbie
 
  
 
 Joined: 14 October 2019
 Online Status: Offline
 Posts: 5
 | 
          I would like to keep the original file format.
           | Posted: 16 October 2019 at 11:29pm | IP Logged |   |  
           | 
 |  
 I have Mail.MSG file which contains two attached files child1.MSG and child2.EML.
 
 Is it possible that parser keeps the original format of child1.MSG and child2.EML? I don't want to convert them. I just want to keep original file format (extension).
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Alex AfterLogic Support
 
  
  
 Joined: 19 November 2003
 Online Status: Offline
 Posts: 2207
 | 
          As I said, there is no original file in MSG but rather "attached message structure". Then the parser builds EML from it.
           | Posted: 17 October 2019 at 6:44am | IP Logged |   |  
           | 
 |  
 It's not like there a MSG BLOB which can be extracted as-is and saved as MSG file.
 
 So internally we just have a bunch of properties from which we build an EML in our case. If we built an MSG, it still wouldn't have the original format.
 
 That MSG doesn't even has any filename. child1.MSG is the name Outlook somehow "invents" by taking the message subject and appending ".msg" to it when displaying this item in the attachment list (like Outlook names attachments similar to "att0001" for untitled attachments).
 
 If we had a way to extract the original MSG out of the containing MSG, we would have offered it. But we hadn't, sorry.
 
 Regards,
 Alex
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | vrhovrho Newbie
 
  
 
 Joined: 14 October 2019
 Online Status: Offline
 Posts: 5
 | 
          Thank you very much for your answer. It will help me explaining the situation to our customers.
           | Posted: 20 October 2019 at 11:18pm | IP Logged |   |  
           | 
 |  | 
       
        | Back to Top |     | 
       
       
        |  |