web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Save email and attachm...
Power Automate
Answered

Save email and attachments to a file system

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

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.

Categories:
I have the same question (0)
  • sandro_asp Profile Picture
    19 on at

    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-receive-processing-points-or-locations-easily-with-microsoft-flow/  

     

    Sandro Pereira

    MVP | Microsoft Azure (Integration)

  • Verified answer
    v-bacao-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous,

     

    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 Power Platform Member Profile Picture
    Microsoft Employee on at

    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

  • Verified answer
    v-bacao-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous,

     

    Yes, just change .eml to .msg

     

    36.PNG

    37.PNG

    Regards,

    Barry

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    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.

     

     

  • LunMax Profile Picture
    15 on at
    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.
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    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

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

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

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    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.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 304

#2
David_MA Profile Picture

David_MA 245 Super User 2026 Season 1

#3
Expiscornovus Profile Picture

Expiscornovus 243 Most Valuable Professional

Last 30 days Overall leaderboard