Setting Up an Email Address for a SharePoint Document Library

This guide explains how to let people send an email (with attachments) to an
address and have those documents land automatically in a SharePoint document
library.

Which SharePoint do you have?


SharePoint Online (Microsoft 365): The old native "email-enable this
library" feature was deprecated. Use the shared mailbox + Power Automate
method below (Part A). This is the path almost everyone needs today.
SharePoint Server (on-premises): The native incoming-email feature still
exists. See Part B (Appendix).


If you're unsure which you have: if you sign in at *.sharepoint.com, you're
on SharePoint Online.

SharePoint Online (shared mailbox + Power Automate)

What you'll build

An email address (e.g. invoices@yourcompany.com) that, when emailed,
triggers an automated flow to save the email's attachments into a specific
document library.

Prerequisites

A Microsoft 365 account with permission to create a shared mailbox
(Exchange Administrator or Global Administrator), or someone who can
create it for you.
A SharePoint site and a document library (or permission to create one).
A Power Automate license. Most Microsoft 365 plans include the standard
Power Automate connectors needed here; premium connectors are not
required for this scenario.

 

Step 1 — Create (or pick) the document library


Go to your SharePoint site.
Select New → Document library.
Give it a clear name, e.g. Incoming Invoices, and select Create.
(Optional but recommended) Add a column to capture useful metadata such as
Mail Sender or Subject, so you can tell where each file came from.

 

Tip: Note the site URL and the library name — you'll select them in
the flow later.

 


Step 2 — Create a shared mailbox

A shared mailbox is preferred over a personal mailbox because it doesn't
require its own license.


Go to the Microsoft 365 admin center (admin.microsoft.com).
Navigate to Teams & groups → Shared mailboxes
(menu wording occasionally changes; it may appear under Exchange admin
center → Recipients → Mailboxes → Shared).
Select Add a shared mailbox.
Enter a name and an email address that reflects its purpose, e.g.
invoices@yourcompany.com.
Save. It can take a few minutes for the mailbox to become available.
Under the mailbox's members/permissions, grant the account that will
own and run the flow access to the mailbox. The flow account needs read
access to this mailbox or the trigger won't fire.

 

Step 3 — Build the Power Automate flow


Go to Power Automate (make.powerautomate.com) and sign in with the
account that has access to the shared mailbox.
Select Create → Automated cloud flow.
Give it a name (e.g. Save emails to Incoming Invoices).
For the trigger, search for and select
"When a new email arrives in a shared mailbox (V2)"
(Office 365 Outlook connector).
In the trigger settings:

Mailbox Address: the shared mailbox you created (e.g.
invoices@yourcompany.com).
Folder: Inbox (default).
(Optional) Set Only with Attachments to Yes and
Include Attachments to Yes so the flow only runs for mail that has
files and actually pulls them in.


Step 4 — Save the attachments to the library


Below the trigger, add an action: Apply to each.
Set the input to the trigger's Attachments field. This loops over every
attachment in the email.
Inside the loop, add the action Create file (SharePoint connector) and
configure:

Site Address: your SharePoint site.
Folder Path: the target document library (e.g. /Incoming Invoices).
File Name: the attachment Name (dynamic content).
File Content: the attachment ContentBytes (dynamic content).

Save the flow.

 

Optional refinements:


Filter by sender/domain: add a Condition before the loop that checks
the trigger's From field, so only trusted senders are processed.
Clean the file name: email subjects and attachment names can contain
characters that are invalid in SharePoint
(" * : < > ? / \ |). Use a Compose action with replace() expressions
to strip them, or you may get failed file-creation steps.
Capture metadata: after Create file, add an Update file properties
action to write the sender or subject into the columns you added in Step 1.

 

Step 5 — Test it


From any mailbox, send an email with an attachment to the shared mailbox
address.
In Power Automate, open the flow's run history and confirm the run
succeeded (a green check).
Open the document library and confirm the attachment appears.
If the run failed, open the failed step to read the error — the most common
causes are an invalid file name, the flow account lacking mailbox access, or
the wrong site/library path.

 

Common pitfalls

SymptomLikely causeFlow never triggersFlow account doesn't have access to the shared mailbox, or "Only with Attachments" excluded the test email"Create file" failsInvalid characters in the file name, or wrong Folder PathEmail body lostThis flow saves attachments. To save the message body too, add an extra Create file that writes the body to an .eml / .txt, or use a template that saves the messageDuplicate filesTwo attachments with the same name overwrite or error — append a timestamp to the file name


SharePoint Server (on-premises) native method

This applies only to on-premises SharePoint Server, where incoming email is
configured in Central Administration first. The per-library steps are:


Open the library you want to enable.
Go to Library Settings → Incoming email settings
(under the "Communications" section).
Set Allow this document library to receive email to Yes.
Enter the email address (the prefix before your configured incoming mail
domain).
Configure how grouped attachments are saved, whether to overwrite files with
the same name, whether to save the original .eml, and which senders are
permitted.
Select OK.

 

Important: The Incoming email settings link only appears if a farm
administrator has already enabled incoming email in Central Administration
(which depends on an SMTP service and a configured mail drop folder). If you
don't see the link, that farm-level setup hasn't been done yet.

Articles in this section

See more