Author |
|
jtsr Newbie
Joined: 20 February 2019 Location: Australia
Online Status: Offline Posts: 8
|
Posted: 16 March 2020 at 10:25pm | IP Logged
|
|
|
The GetHtmlAndSaveRelatedFiles() method appears to create a folder within the Parser.WorkingFolder path, which is excellent as it ensures all email files are isolated.
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: 2206
|
Posted: 17 March 2020 at 12:59am | IP Logged
|
|
|
Hi,
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
|
Posted: 17 March 2020 at 3:41pm | IP Logged
|
|
|
Thanks Alex, but it's doing what I would have expected. I'll try to explain what I'm trying to do.
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
|
Posted: 17 March 2020 at 4:02pm | IP Logged
|
|
|
Ah ha! Is this what I'm after?
MessageParserConfig.GetMessageFolder()
|
Back to Top |
|
|
jtsr Newbie
Joined: 20 February 2019 Location: Australia
Online Status: Offline Posts: 8
|
Posted: 17 March 2020 at 4:38pm | IP Logged
|
|
|
It's now working beautifully with MessageParserConfig.GetMessageFolder()
|
Back to Top |
|
|
jtsr Newbie
Joined: 20 February 2019 Location: Australia
Online Status: Offline Posts: 8
|
Posted: 17 March 2020 at 5:41pm | IP Logged
|
|
|
While I'm at it, is there a way of saving only actual attachments rather than all images that appear in the EML file?
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: 2206
|
Posted: 18 March 2020 at 12:56am | IP Logged
|
|
|
By setting ignoreInlineAttachments=true when calling SaveAll(folderName, ignoreInlineAttachments) method.
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: 2206
|
Posted: 19 March 2020 at 1:21am | IP Logged
|
|
|
You can submit a sample of EML in question to our helpdesk at https://s.afterlogic.com/helpdesk
Regards,
Alex
|
Back to Top |
|
|