| Author |  | 
      
        | jtsr Newbie
 
  
 
 Joined: 20 February 2019
 Location: Australia
 Online Status: Offline
 Posts: 8
 | 
          The GetHtmlAndSaveRelatedFiles() method appears to create a folder within the Parser.WorkingFolder path, which is excellent as it ensures all email files are isolated.
           | Posted: 16 March 2020 at 10:25pm | IP Logged |   |  
           | 
 |  
 Is it possible to save all attachments in a MailMessage to the same directory?
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Alex AfterLogic Support
 
  
  
 Joined: 19 November 2003
 Online Status: Offline
 Posts: 2207
 | 
          Hi,
           | Posted: 17 March 2020 at 12:59am | IP Logged |   |  
           | 
 |  
 Sure:
 
 msg.Attachments.SaveAll(msg.Parser.WorkingFolder);
 
 Regards,
 Alex
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | jtsr Newbie
 
  
 
 Joined: 20 February 2019
 Location: Australia
 Online Status: Offline
 Posts: 8
 | 
          Thanks Alex, but it's doing what I would have expected. I'll try to explain what I'm trying to do.
           | Posted: 17 March 2020 at 3:41pm | IP Logged |   |  
           | 
 |  
 First, I set msg.Parser.WorkingFolder to a directory, eg. c:\jtsr\temp\email
 
 Then I call msg.GetHtmlAndSaveRelatedFiles(msg.Parser.WorkingFolder, VirtualMappingType.Static, MessageFolderBehavior.CreateAndDelete)
 
 This method call creates an email specific folder, c:\jtsr\temp\email\A292F1..., and saves the content of the email (signature icons, inline images) in that folder.
 
 However, the msg.Attachments.SaveAll(msg.Parser.WorkingFolder) call places the email attachments in c:\jtsr\temp\email, not in c:\jtsr\temp\email\A292F1...
 
 I'd like all content and attachments for a single email to be contained in their own folder. I realise I can create a folder using Directory.Create() and manage it all manually, however I was hoping the library would manage this for me :)
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | jtsr Newbie
 
  
 
 Joined: 20 February 2019
 Location: Australia
 Online Status: Offline
 Posts: 8
 | 
          Ah ha! Is this what I'm after?
           | Posted: 17 March 2020 at 4:02pm | IP Logged |   |  
           | 
 |  
 MessageParserConfig.GetMessageFolder()
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | jtsr Newbie
 
  
 
 Joined: 20 February 2019
 Location: Australia
 Online Status: Offline
 Posts: 8
 | 
          It's now working beautifully with MessageParserConfig.GetMessageFolder()
           | Posted: 17 March 2020 at 4:38pm | IP Logged |   |  
           | 
 |  | 
       
        | Back to Top |     | 
       
       
        |  | 
        | jtsr Newbie
 
  
 
 Joined: 20 February 2019
 Location: Australia
 Online Status: Offline
 Posts: 8
 | 
          While I'm at it, is there a way of saving only actual attachments rather than all images that appear in the EML file?
           | Posted: 17 March 2020 at 5:41pm | IP Logged |   |  
           | 
 |  
 If I use the Attachments.SaveAll method, it returns all the signature icons as well. Is there a way to only return attachments that were attached to the email?
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Alex AfterLogic Support
 
  
  
 Joined: 19 November 2003
 Online Status: Offline
 Posts: 2207
 | 
          By setting ignoreInlineAttachments=true when calling SaveAll(folderName, ignoreInlineAttachments) method.
           | Posted: 18 March 2020 at 12:56am | IP Logged |   |  
           | 
 |  
 Regards,
 Alex
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | jtsr Newbie
 
  
 
 Joined: 20 February 2019
 Location: Australia
 Online Status: Offline
 Posts: 8
 | 
          
           | Posted: 18 March 2020 at 2:30pm | IP Logged |   |  
           | 
 |  
| Alex wrote: 
 
    
    | 
      
       | By setting ignoreInlineAttachments=true when calling SaveAll(folderName, ignoreInlineAttachments) method. 
 Regards,
 Alex
 |  |  |  
 I tried this, however it is returning all attachments as inline for some reason. I’ve tried it in multiple eml files and all attachments are being treated the same.
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Alex AfterLogic Support
 
  
  
 Joined: 19 November 2003
 Online Status: Offline
 Posts: 2207
 | 
          You can submit a sample of EML in question to our helpdesk at https://s.afterlogic.com/helpdesk
           | Posted: 19 March 2020 at 1:21am | IP Logged |   |  
           | 
 |  
 Regards,
 Alex
 | 
       
        | Back to Top |     | 
       
       
        |  |