cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Saving email attachments (.msg) with flow

Hello Experts,

 

I m working on flow. where I need to save attachment in Sharepoint Libary. 

It is working for all type of files (pdf, word, xls).. But It doesnt work if email attachment comes with (.msg) or eml

 

A user send email with another email as attachment. So I m wanting to save that attachment into SharePoint. 

It seems .MSG is not being recogized as attachment.

 

Anybody else faced issue like this ?

 

Any help will be much appericaited. 

Regards

T

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Saving email attachments (.msg) with flow

Hi @Anonymous ,

 

I did the test on my side and there is indeed a scene you described.

I guess you added Outlook Item as an attachment in Outlook client, so this happens.

 

Currently, MS Flow cannot save Outlook items. Even if you add locally stored .eml or .msg files as attachments, they will be automatically sent as Outlook Item on Outlook client.

This type of file is judged in MS Flow as no attachment included in the email, so the file cannot be extracted. Moreover, the size of the file is 0, and there is no file content that can be extracted.

 

But if you use Outlook.com to send mail and send the locally saved .eml/.msg file as an attachment, we could save these attachments file in SharePoint Library.

 

Please take a try.

 

Best Regards,

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

18 REPLIES 18
Highlighted
Community Support
Community Support

Re: Saving email attachments (.msg) with flow

Hi @Anonymous ,

 

I did the test on my side and there is indeed a scene you described.

I guess you added Outlook Item as an attachment in Outlook client, so this happens.

 

Currently, MS Flow cannot save Outlook items. Even if you add locally stored .eml or .msg files as attachments, they will be automatically sent as Outlook Item on Outlook client.

This type of file is judged in MS Flow as no attachment included in the email, so the file cannot be extracted. Moreover, the size of the file is 0, and there is no file content that can be extracted.

 

But if you use Outlook.com to send mail and send the locally saved .eml/.msg file as an attachment, we could save these attachments file in SharePoint Library.

 

Please take a try.

 

Best Regards,

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
Anonymous
Not applicable

Re: Saving email attachments (.msg) with flow

Thanks for your reply. 

 

unfortunately sending files through outlook.com and localy saved .eml doesn't solve my problem.

 

Highlighted
Frequent Visitor

Re: Saving email attachments (.msg) with flow

Hello,

 

I have similar issue. Before I try your suggestion, will this is applicable for O365 email as well?

Highlighted
Helper IV
Helper IV

Re: Saving email attachments (.msg) with flow

I'd also like to have the .eml file attached to a SharePoint List Item.  The email attachments work, but I not the .eml file.  It does save it to a document library in Teams (Documents > General > Email Messages), but I would like that same .eml file saved to this library attached to my sharepoint list.  Is it possible?

Thanks

Kim

Highlighted
Super User II
Super User II

Re: Saving email attachments (.msg) with flow

Hey @kmw1130 @am345357 @v-bacao-msft 

I may have misunderstood the question here... but saving an email message as a SharePoint list item attachement (EML) with contained attachments is pretty simple.

The Flow:

1.png

 

The item in SharePoint:

2.png

 

The attachment:

d3.pngHTH

Jay

Highlighted
Helper IV
Helper IV

Re: Saving email attachments (.msg) with flow

@Jay-Encodian I tried that, but it didn't really work.  It added an .eml attachment, but it is not attaching to my SharePoint list item.

The only difference between yours and mine is you have an export email.  Do I need that? 

flow.png

Highlighted
Super User II
Super User II

Re: Saving email attachments (.msg) with flow

@kmw1130 

There's quite a few differences between my flow and yours 🙂

Yes, you need to export the email... the export will include the attachments so there is no need to separately attach each attachment on the email to the list item unless you want them in addition to the *.eml file

BTW - your current Flow wouldn't work properly if there was more than 1 attachment on the email as you're adding the EML file for every single attachement... i.e. if there were two attachments on the email your flow would add each attachment at the EML twice.

Highlighted
Helper IV
Helper IV

Re: Saving email attachments (.msg) with flow

@Jay-Encodian I do want the attachments in addition to the email, but I'm going to try doing it the way you suggest and see if that'll work for me.

I still want it to forward to my Teams though, just to have a copy saved there.  Can I keep that step in for it to work?

Thanks you!

Highlighted
Super User II
Super User II

Re: Saving email attachments (.msg) with flow

@kmw1130 

If you need the attachments separately then just add them.., I was just pointing out that the EML file also contains the attachments so you're in affect adding the attachments twice. If you're adding the attachments separately why not just convert the email HTML content to PDF and add along with the attachments? no need for an EML file then

Highlighted
Helper IV
Helper IV

Re: Saving email attachments (.msg) with flow

@Jay-Encodian Then would I need my Apply to Each to add the Attachments separately?

Highlighted
Super User II
Super User II

Re: Saving email attachments (.msg) with flow

@kmw1130Yep, which is fine... the loop is there two process each attchment where there could be multiple.

Just don't include the step to add the EML file or convert the body to PDF and attach in the loop as you only want to do that once.

Highlighted
Helper IV
Helper IV

Re: Saving email attachments (.msg) with flow

@Jay-Encodian I'm sorry for bugging you, I tried just the email attachment and nothing got attached to the sharepoint list.

flow.PNG

Highlighted
Super User II
Super User II

Re: Saving email attachments (.msg) with flow

@kmw1130no probs 🙂

Is that your full Flow? you need to export the email from the mailbox not from a forwarded mail action... you also need to check you're passing the body value from the 'Export Email' action

Highlighted
Helper IV
Helper IV

Re: Saving email attachments (.msg) with flow

@Jay-Encodian Yes, that was my entire flow.  I will move the export and retest.

Thanks again!

Highlighted
Helper IV
Helper IV

Re: Saving email attachments (.msg) with flow

@Jay-Encodian Somewhat success.  I got it to add both the attachment and the email to the list item, but the email is coded and not in a format that can be easily read.

 

Highlighted
Super User II
Super User II

Re: Saving email attachments (.msg) with flow

@kmw1130 

What are you doing to create the email?

Highlighted
Helper IV
Helper IV

Re: Saving email attachments (.msg) with flow

@Jay-Encodian I have success!!  I have forgotten to add the .eml after the Subject

attachments.PNG

Thanks again for all your help!!

Highlighted
Helper II
Helper II

Re: Saving email attachments (.msg) with flow

HI,

 

I am new to sharepoint and while using the "create item" connector I am unable to see anything in the list name option. I have navigated to the site and created a new list manually , but still its not getting populated in the connector

 Any help?

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (6,848)