Showing results for 
Search instead for 
Did you mean: 
Advocate II
Advocate II

How to get file content to attach to email (not with sharepoint)?

Is there any alternative to the Sharepoint Get-Content options?  I have files in a microsoft teams channel which I need to email, but I can't use sharepoint for security reasons, is there a Graph call or any other way to get the file content?






Community Support
Community Support

Hi @bcampbell13 :

Do you want to get files from microsoft teams channel and send them via email?

I am afraid there is no other way, because In fact, the files in the message are stored in SharePoint Library.

Teams group will generate the SharePoint Site group and store the files in Shared Document. Each Channel has a corresponding folder.

I think this link will help you a lot:

In addition, you can download the file and save it in OneDrive, and then use OneDrive's related actions to get the file content.

Best Regards,


Let me clarify, Teams (Sharepoint) is fine to hold the data.  What I'm doing is creating an excel file from data and then attaching it and sending the file.  I use Microsoft Graph calls to create the excel, write all the data, which works great and it's stored in the teams channel.  The only problem is, that one call to get the file content (file) to attach it to the email, can only be done with the Sharepoint Connector: Get File Content.  My users can't have access to sharepoint, so I can not use that connector.


Is there a way to get the file content through microsoft graph or can I make the sharepoint call via RestAPI so it does not need the connector?


All I need is some way to access the file to get it's content, which is not the sharepoint connector.

Hi @bcampbell13 :

I'm afraid that is not available.If the user does not have access to the SharePoint Site ,then he can not obtain the file in the SharePoint Site.

If the user can not get the files in the channel from SharePoint, I think the only way is to capture the attachments in the message in real time when the message in the channel is created.I think this link will help you a lot:

This case uses the "When a channel message is created" action to capture the newly created message in the channel, and then get the attachment in the message. on your side, then you can use OnDrive to create and save files.

Best Regards,


Helpful resources

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Top Solution Authors
Top Kudoed Authors
Users online (1,450)