--- title: "Set up file action - Email - Exchange Online (Microsoft 365)" slug: "set-up-file-action-email-exchange-online-microsoft-365" description: "Set up Email file actions in Exchange Online to send and receive files, manage attachments, and streamline your workflow with Azure and SharePoint." tags: ["Connectivity Studio", "CS", "Task"] status: "new" updated: 2026-09-22T13:18:59Z published: 2026-09-22T13:18:59Z canonical: "docs.staedean.com/set-up-file-action-email-exchange-online-microsoft-365" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.staedean.com/llms.txt > Use this file to discover all available pages before exploring further. # Set up file action - Email - Exchange Online (Microsoft 365) You can use the **Email** file action to exchange files with email. This topic explains how to set up a file action to send or receive files using **Exchange Online (Microsoft 365)**. If the direction is: - **Source**, before the message is run, the defined email account inbox is searched for applicable emails. If found, the attached files of these emails are saved to the **Working** folder. - **Target**, after the message is run, an email is created using the defined email account, the created file in the **Working** folder is attached to the email, and the email is sent. The original file stays in the **Working** folder. If you want to zip the file before sending it by email, do a **Zip** file action previously to the **Email** file action. In this case the zipped file is attached to the email. > [!NOTE] > Note > > You can set up file actions for these connector types: > > - **Azure file storage** > - **Azure File Storage (API)** > - **Azure Blob storage** > - **SharePoint** > > Before you set up this file action, make sure: > > - An Azure AD [app registration](https://learn.microsoft.com/en-us/graph/auth-register-app-v2) exists for the target Microsoft 365 tenant. > - The app registration has the required Exchange Online permissions, granted and admin-consented. For more information, refer to Microsoft Learn. For example, [Overview of Microsoft Graph permissions](https://learn.microsoft.com/en-us/graph/permissions-overview). > - A [secret reference](/data-management/docs/set-up-secret-references) exists for the app registration's client secret. ### Steps 1. Click **Connectivity studio - Integration Design**. 2. Click the **Connectors** tab. 3. In the list, find and select the desired connector. 4. Click **Edit**. 5. You can export the connectivity setup and import it into another D365 F&SCM environment. For example, you first set up and test the connectivity setup in a development environment. When finished, you deploy the setup in your production environment. To protect your production data, use different file locations for your development or testing environment and for your production environment. To strictly distinguish between different environments, you can define unique file action properties for each of your environment types. So, each file action can have a different set of properties for each applicable environment type. Which file action properties are applicable to the current environment is defined in the **Environment type** field on the **Connectivity studio parameters**. **Example**: If set to **Development**, the file action properties, as defined for environment type **Development** are applicable. In the **Environment types** field, select an option. > [!NOTE] > **Note** > > For each file action, you can repeat the sub-tasks for each of your environment types. To set the environment-specific properties of a file action, only change the environment type, find the file action, and set the properties. So, do not create a new file action for each environment type. 6. Expand the **File action** section. 7. Sub-task: Set up an **Email** file action with direction **Source**. 1. Click **New**. 2. In the **Name** field, type a value. 3. In the **File action** field, select **Email**. 4. Click **Save**. 5. In the **Direction** field, select **Source**. 6. You can (temporarily) disable a flow action. **Example**: In a test setup, the setup to do the file action is not available. To prevent errors during test runs of the message, you disable the file action. In this way, you do not have to change or delete the file action. In the **Skip** field, select an option. 7. In the **Email receiver** field, select **Exchange Online (Microsoft 365)**. 8. Define the email address of the account to be searched for emails and attached files. In the **Email** field, type a value. 9. Define the Microsoft 365 tenant to which the app registration belongs. In the **Tenant ID** field, type a value. 10. Define the application (client) ID of the app registration that is used to access the mailbox. In the **Client ID** field, type a value. 11. Define the client secret or client secret reference of the app registration that is used to access the mailbox. Whether the client secret or client secret reference applies is defined by the **Display secret** field in the **Connectivity studio parameters**. If the **Display secret** parameter is set to: - **Secret**, fill in the **Client secret** field with the desired client secret. The client secret is specific for the current connector. - **Secret reference**, fill in the **Client secret reference** field with the desired secret reference. The client secret reference refers to a centrally stored client secret which makes updating secrets easier. - **Both**, fill in either the **Client secret** field or the **Client secret reference** field. In the **Client secret** field or in the **Client secret reference** field, type a value. 12. You can define which emails are considered when the inbox of the email account is searched. In the **Read filter** field, select an option. 13. You can filter for which senders emails are considered when the inbox of the email account is searched. In the **Sender filter** field, type a value. 14. You can filter for which subjects emails are considered when the inbox of the email account is searched. In the **Subject filter** field, type a value. 8. Sub-task: Set up an **Email** file action with direction **Target**. 1. Click **New**. 2. In the **Name** field, type a value. 3. In the **File action** field, select **Email**. 4. Click **Save**. 5. In the **Direction** field, select **Target**. 6. Click **Save**. 7. You can (temporarily) disable a file action. **Example:** In a test setup, the setup to do the file action is not available. To prevent errors during test runs of the message, you disable the file action. In this way, you do not have to change or delete the file action. In the **Skip** field, select an option. 8. In the **Email sender** field, select **Exchange Online (Microsoft 365)**. 9. Define the email address to be used to send the email with the attached file. In the **Email** field, type a value. 10. Define the Microsoft 365 tenant that the app registration belongs to. In the **Tenant ID** field, type a value. 11. Define the application (client) ID of the app registration that is used to send the email. In the **Client ID** field, type a value. 12. Define the client secret or client secret reference of the app registration that is used to send the email. Whether the client secret or client secret reference applies is defined by the **Display secret** field in the **Connectivity studio parameters**. If the **Display secret** parameter is set to: - **Secret**, fill in the **Client secret** field with the desired client secret. The client secret is specific for the current connector. - **Secret reference**, fill in the **Client secret reference** field with the desired secret reference. The client secret reference refers to a centrally stored client secret which makes updating secrets easier. - **Both**, fill in either the **Client secret** field or the **Client secret reference** field. In the **Client secret** field or in the **Client secret reference** field, type a value. 13. Define the email address to which the email with the attached file must be sent. In the **Send-to address** field, type a value. 14. Enter the subject for the email to be sent with the attached file. In the **Email subject** field, type a value. 15. Enter the body text for the email to be sent with the attached file. In the **Email body** field, type a value. 9. Close the page. ## Related - [Set up secret references](/set-up-secret-references.md) - [Set up file action - Email](/set-up-file-action-email.md) - [Set up file action - Email - Exchange server](/set-up-file-action-email-exchange-server.md) - [Set up file actions for a connector](/set-up-file-actions-for-a-connector.md)