cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

Save email and attachments to a file system

Hi,

 

I´m trying to create a flow to save all the emails received in a email account including the attachments, if exist, in a single file or a folder in my local server using the file system option.

 

Following a templante I have got a flow which save in a file the attachment, but if there are more than one it saves only the first attachment. When I try to save the body and the attachment in a single file, the flow creates a file without extension and I can´t read it.

 

How could I create this flow?

 

I have this right now:

 

http://subefotos.com/ver/?74eb6cddff9d26f59c09a92d0cba7c01o.png

 

Thanks in advance.

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Save email and attachments to a file system

Hi @nanoterremoto,

 

Do you want to save email and attachments?

If you want to save the contents of the body and the attachment in the same file, I think there is no way to do it. The file type of the attachment is undefined, so the combined file type does not exist and cannot be read.

You could consider using the Export email action to export the email and then store it in the same folder with attachments.

Use the Body exported by Export email to save the file with the file extension ".eml".

Image reference:

34.PNG

It work, created a folder, saved the email and all attachments, as below:

33.PNG35.PNG

Please take a try.

 

Best Regards,

Barry

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Community Support
Community Support

Re: Save email and attachments to a file system

Hi @nanoterremoto,

 

Yes, just change .eml to .msg

 

36.PNG

37.PNG

Regards,

Barry

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

10 REPLIES 10
Highlighted
Frequent Visitor

Re: Save email and attachments to a file system

Hi,

 

Yes, you can create this type of Flow. I have similar flows created and working perfectly.

I'm not able to verify on your picture but on the Create File Action, on the property Archive Name you need to select "Attachments Name" token from the list of tokens from the “When a new email arrives” trigger.Untitled.png

 

Actually, there are several ways for you to accomplish this, you can use the File connector and for that, you need to connect to File Systems on your local or network machines to read from and write to files using the On-Premises Data Gateway. Or you can simply use the DropBox and use the Dropbox client to sync with your local system like this sample that I published: https://blog.sandro-pereira.com/2018/06/18/flows-to-the-help-how-to-extend-smartdocumentor-ocr-recei...

 

Sandro Pereira

MVP | Microsoft Azure (Integration)

Highlighted
Community Support
Community Support

Re: Save email and attachments to a file system

Hi @nanoterremoto,

 

Do you want to save email and attachments?

If you want to save the contents of the body and the attachment in the same file, I think there is no way to do it. The file type of the attachment is undefined, so the combined file type does not exist and cannot be read.

You could consider using the Export email action to export the email and then store it in the same folder with attachments.

Use the Body exported by Export email to save the file with the file extension ".eml".

Image reference:

34.PNG

It work, created a folder, saved the email and all attachments, as below:

33.PNG35.PNG

Please take a try.

 

Best Regards,

Barry

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Regular Visitor

Re: Save email and attachments to a file system

I would like to do something like that but instead of save an eml file, could it be possible to save a .msg file using the export option to save the complete email (body, attachments, etc)?

 

Thanks

Highlighted
Community Support
Community Support

Re: Save email and attachments to a file system

Hi @nanoterremoto,

 

Yes, just change .eml to .msg

 

36.PNG

37.PNG

Regards,

Barry

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Regular Visitor

Re: Save email and attachments to a file system

Thanks a lot, at last I have done what I want to do.

 

I only use one step less because saving the .eml file I have body and attachments in a single file so I don´t need to save attachments separately.

 

 

Highlighted
Frequent Visitor

Re: Save email and attachments to a file system

Hello, forgive automatically create the folder for example with the name of the subject and in the email and attachments? You can share the flow screen. Thanks in advance.
Highlighted
Advocate I
Advocate I

Re: Save email and attachments to a file system

This dosen't work for me, I can save the files as .msg, but when i try to open it in Outlook it gives me a permission error.

2019-04-05 08_00_41-Window.png

Highlighted
Regular Visitor

Re: Save email and attachments to a file system

When .msg there are problems, I use .eml and it works fine.

Highlighted
Advocate I
Advocate I

Re: Save email and attachments to a file system

Same for me, but we have another system that works best with .msg so it would be alot better if I could save in that format.

Highlighted
Frequent Visitor

Re: Save email and attachments to a file system

Hello Everyone,

 

I followed the steps and can store attachments to my local system. However, if email is attached within received email, that is not getting saved to location. Is there any trick that I am missing?

 

Help is appreciated in advance.

Helpful resources

Announcements
firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (7,021)