How to Enable Incoming Mails in SharePoint Online

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.

On Prem Setting

but unfortunately this feature is not available in SharePoint Online yet.

Alternate Solutions

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.

Microsoft Flow

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.

Pre-requisites

  • 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

Mail Box Creation

  • 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.

Mail Box Creation-2

Now, we have a shared mailbox created on which users will send mails with attachments to store documents in corresponding SharePoint document library.

Reset Password

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

Search Mail boxes User

  • Once found, click on the name to open the properties window
  • Click on Reset Password and set a new password for this account

Reset Password

Create Flow

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

My Flow

  • 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

Search Flow 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

Create Flow From Template

  • At this stage the flow gets created, but the required fields do not have actual values which we want.

Flow

Configure Flow

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.

Configure Source

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.

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

Added New Connection

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.

Show Picker

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.

Select SP Lib

You will get this success screen, click Done.

Click Done

Now are flow is configured, enabled and ready to run whenever a mail is received in our shared mailbox.

Flow Created

Verification

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.

Send Mail To SPO

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.

Flow Executed

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.

Document Uploaded

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.

Drawbacks

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.

Summary

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.

Enjoy,
Anupam

You may also like

4 comments

  1. This is useful as a workaround for cloud based solutions. What the post above doesn’t consider are:

    1. Treatment of duplicate file names – the sender has no knowledge that the upload has failed if there’s already file with the same name on the destination Doc Library.

    2. Email footers contain images that are treated as files and uploaded, soon cluttering the document library with useless images files.

    What is needed is a document type policy with a way to administer a test at runtime to ensure that the files attached marry up with allowable files only (say only .xlsx, .pdf and .docx as an example) with a message to the sender to say some files did not match the criteria and therefore weren’t uploaded.

    In addition, if a file with the same name exists on the destination folder, notify the person trying to upload so they can take appropriate action.

  2. Great tutorial. But is it possible to recieve calendar invitations to this newly created mailbox and to write these events in a sharepoint calendar?

Leave a Reply

Your email address will not be published. Required fields are marked *

5 × two =