Incoming emails or sending documents to SharePoint document libraries has been one of the most loved features of SharePoint by business users for long. This has been there since SharePoint 2007 and all on-premise versions including the latest SharePoint 2016. Even though, it requires quite some steps and infra components to do the initial setup, once running, it gives business users real ease of uploading documents to SharePoint library directly from their mail client like outlook.
With more and more companies looking to move to SharePoint Online, lack of this feature always comes as a tricky discussion between IT and business users. In on-premise system, they can just enable any document library for incoming mails and even control who can send documents via mail.
but unfortunately this feature is not available in SharePoint Online yet.
Obviously, since this issue has been there for sometime now, SharePoint experts came up multiple workarounds like these. But none of these seem to fit the exact requirement easily, except last one which mentions Microsoft Flow.
The solution we are going to discuss today will use Microsoft Flow that can potentially provide almost similar functionality (with some drawbacks) with least efforts.
We can make use of Microsoft Flow to create a simple flow which will read mails from a Shared Mailbox in Exchange Online, get the attached documents and upload those in the SharePoint Online document library.
- An Office 365 account with Flow license assigned
- This account needs to be exchange administrator and user management administrator or Global administrator of the tenant. Alternatively, you can ask an existing administrator to perform the tasks
- A shared mailbox for each document library which needs to be mail enabled
- A SharePoint Online Site Collection with Document Library
Create a Shared Mailbox
Our first step is to create a shared mailbox that will be used as a mailbox for one specific SharePoint document library. You can also use any personal mailbox for this purpose, but since Shared Mailboxes don’t require licenses assigned, that’s a better choice.
If your account has exchange administrator permission (or global admin of tenant), then you can follow the steps yourself or ask any admin to do it for you.
- Go to Office 365 Admin portal
- Browse to Exchange Admin Center
- Select “recipients” from left nav, shared from top menu and click on the “+” icon
- Enter the Display name, email address to be used for the document library and the accounts under which the flow will run and click OK.
Now, we have a shared mailbox created on which users will send mails with attachments to store documents in corresponding SharePoint document library.
To use this mailbox in Microsoft Flow, we need to get the password for this newly created mailbox.
- Go to Office 365 Admin Portal and Click on Active Users from left menu
- Search for the newly created mailbox
- Once found, click on the name to open the properties window
- Click on Reset Password and set a new password for this account
Now that we have the required mailbox and it’s password in place, lets go ahead and create our flow.
- Go to Microsoft Flow and login with your Office 365 account. This account need not be the same mailbox account.
- Click on My flows and then on Create from template
- In the next page, search for the required template by typing in “save my email attachment to sharepoint document library” and press enter
- You would see one template appearing. Click on that template
- It will show another page with source information and if with the given credentials, it could connect to those sources (exchange and sharepoint) or not.
- If all is good, then you would see green icons next to each source. Click on Continue to create the flow
- At this stage the flow gets created, but the required fields do not have actual values which we want.
Now that we have our flow created based on the desired template, we can configure it to read the attachments received in the mailbox that we created and upload to the document library of our choice.
We first need to configure the source which will trigger the flow to start. This mean, when any new mail is received. For this we want to monitor the shared mailbox created earlier. So, we need to add that account under my connections. Click on the three dots (…) and click on Add new connection.
It will pop-up a credential login window. Login with the email ID of the shared mailbox and password created earlier.
Once created, you can see that added under My connections
Once the connection is added, we need to configure which folder to look into the incoming mails. So, click on the folder icon next to the text box with screen tip as “mail folder to check for new emails” and select Inbox from the menu. You may also want to select Has Attachment and Include Attachment to yes to ensure this flow only triggers when the incoming mail has any attached documents.
So now the source is set. Let’s configure SharePoint part.
Select the Site URL either from dropdown or just by typing it in the site URL in Site Address and then the document library in the Folder Path field and click Save Now.
You will get this success screen, click Done.
Now are flow is configured, enabled and ready to run whenever a mail is received in our shared mailbox.
Now that all is configured, let’s send a mail to our shared mailbox and see if our flow works as expected. From our outlook or any other mail client just attach a sample document and sent that to the email id of the shared mailbox.
It may take a few minutes, before you can see the flow gets triggered. wait for 5-15 minutes and then check your flow. It should come up as succeeded under Run History.
Now, it’s time to look into our SharePoint document library which we had configured in the flow and find out if that attached document was uploaded. You would see the document was uploaded and modified by would appear as the same account under which the flow gets executed.
So, all good. We have a SharePoint document library to which we can send documents via mail. For each such document library, we can create a new shared mailbox and a flow. You can share this flow with your colleagues to make it a Team Flow, so that they can also monitor and manage it.
Even though this incoming mail solution for SharePoint Online works with less than 15 minutes of effort, it still lacks many features which are there in on-premise version out of the box.
- For simplest implementation, a separate shared mailbox needs to be created for each library, so there is a dependency of exchange administrator.
- To reset the password, there is a dependency of User management administrator
- Either some admin needs to configure all flows for all required email enabled libraries or corresponding site admins should have the technical knowledge to be able to do it themselves.
- It is not easy to restrict permissions to the users who have permissions to upload in the corresponding document libraries. Specially, if there are large number of such users are there.
I will just summarize by saying Microsoft Flow provides a really easy and useful way to configure incoming mail feature in SharePoint Online. For me this is a preferred solution, as it doesn’t require users to move to Microsoft Groups, Teams etc. and provides the same document upload experience as in their existing SharePoint sites.