title | description | author | ms.author | ms.topic | ms.search.keywords | ms.search.form | ms.date | ms.custom | ms.service | ms.reviewer |
---|---|---|---|---|---|---|---|---|---|---|
Set up email in Business Central |
Describes how to connect email accounts to Business Central so that you can send outbound messages without having to open another app. |
brentholtorf |
bholtorf |
get-started |
SMTP, email, Office 365, connector |
1805, 9813, 9814, 1262, 1263, 8898_Primary, 8897_Primary |
06/03/2024 |
bap-template |
dynamics-365-business-central |
bholtorf |
[!INCLUDEazure-ad-to-microsoft-entra-id]
People in businesses send information and documents, such as sales and purchase orders and invoices, by email every day. Administrators can connect one or more email accounts to [!INCLUDEprod_short], letting you send documents without having to open an email app. You can compose each message individually with basic formatting tools, such as fonts, styles, colors, and so on, and add attachments of up to 100 MB. Additionally, report layouts enable administrators to include only the key information from documents. Learn more at Send Documents by Email.
Email capabilities in [!INCLUDEprod_short] are for outbound messages only. You can't receive replies, that is, there's no "Inbox" page.
Note
You can use the email capabilities of [!INCLUDEprod_short] online only with Exchange Online. We don't support hybrid scenarios, such as connecting [!INCLUDEprod_short] online to an on-premises version of Exchange.
If you're using [!INCLUDEprod_short] on-premises, before you can set up email you must create an app registration for [!INCLUDEprod_short] in the Azure Portal. The app registration will enable [!INCLUDEprod_short] to authorize and authenticate with your email provider. Learn more at Set Up Email for Business Central On-Premises. In [!INCLUDEprod_short] online, we handle this for you.
There are a couple of requirements for setting up and using the email features.
- To set up email, you must have the EMAIL SETUP permission set. For more information, see Assign Permissions to Users and Groups.
- Everyone who will use the email features must be a fully-licensed [!INCLUDE prod_short]. For example, delegated admins and guest users can't use the tenant's email account.
You add email accounts through extensions that enable accounts from different providers to connect to [!INCLUDEprod_short]. The standard extensions let you use accounts from Microsoft Exchange Online. However, other extensions that let you connect accounts from other providers, such as Gmail, might be available.
You can specify predefined business scenarios in which to use an email account to send emails. For example, you can specify that all users send sales documents from one account, and purchase documents from another. Learn more at Assign Email Scenarios to Email Accounts.
The following table describes the email extensions that are available by default.
Extension | Description | Examples of when to use |
---|---|---|
Microsoft 365 Connector | Everyone sends email from a shared mailbox in Exchange Online. | When all messages come from the same department, for example, your sales organization sends messages from a sales@cronus.com account. This option requires that you set up a shared mailbox in the Microsoft 365 admin center. For more information, see Shared mailboxes. |
Current User Connector | Everyone sends email from the account they used to sign in to [!INCLUDEprod_short]. | Allow communications from individual accounts. |
SMTP Connector | Use SMTP protocol to send emails. | Allow communications through your SMTP mail server. |
The Microsoft 365 Connector and Current User Connector extensions use the accounts you set up for users in the Microsoft 365 admin center for your Microsoft 365 subscription. To send email using the extensions, users must have a valid license for Exchange Online. Additionally, in sandbox environments, these extensions, including the Outlook REST API extension, require that the Allow HttpClient Requests setting is enabled. To check whether it is enabled for these extensions, go to the Extension Management page, choose the extension, and then choose the Configure option.
External users, such as delegated admins and external accountants, can't use these extensions to send email messages from [!INCLUDEprod_short].
Note
If you’re using service-to-service (S2S) authentication, the Microsoft 365 and Current user connectors can’t authenticate the user when they send a sales or purchase document by email. When someone sends a document, the following error message displays:
“You are not authorized to access this resource: https://graph.microsoft.com/.default. Contact your system administrator."
The problem is caused by the bound actions on the document APIs that send email. To learn more about the bound actions, go to Bound Actions.
If you want to use S2S authentication and the email features, use the SMTP connector option.
[!VIDEO https://www.microsoft.com/en-us/videoplayer/embed/RE4JsUk]
If you want to use SMTP protocol to send emails from [!INCLUDEprod_short], you can use the SMTP Connector extension. When you set up an account that uses SMTP, the Sender Type field is important. If you choose Specific User, emails will be sent using the name and other information from the account you're setting up. However, if you choose Current User, emails will be sent from the email account specified for each user's account. Current User is similar to the Send As feature. For more information, see Use a Substitute Sender Address on Outbound Email Messages.
Important
To use OAuth for SMTP, all users must be on the same Microsoft Entra tenant.
You must create an application registration in the Azure portal, and then run the Set up Microsoft Entra ID assisted setup guide in [!INCLUDEprod_short] to connect to Microsoft Entra ID. For more information, see Create an App Registration for Business Central in Azure Portal.
Exchange Online is deprecating use of Basic authentication for SMTP. Tenants that are currently using SMTP AUTH won't be affected by this change. However, we strongly recommend using the latest version of [!INCLUDE prod_short] and setting up OAuth 2.0 authentication for SMTP. We will not add certificate-based authentication for earlier versions of [!INCLUDE prod_short], for example, version 14. If you can't set up OAuth 2.0 authentication, we encourage you to explore third-party alternatives if you want to use SMTP email in earlier versions.
[!INCLUDE email-copy-company]
The Set Up Email assisted setup guide can help you get started quickly with emails.
Note
You must have a default email account, even if you add only one account. The default account will be used for all email scenarios that aren't assigned to an account. Learn more at Assign Email Scenarios to Email Accounts.
- Choose the
icon, enter Set Up Email Accounts, and then choose the related link.
- Fill in the fields as necessary. [!INCLUDEtooltip-inline-tip]
Email scenarios are processes that involve sending a document. For example, a sales or purchase order or a notification, such as an invitation to an external accountant. Specific email accounts can be used for specific scenarios. For example, you can specify that all users always send sales documents from one account, purchase documents from another, and warehouse or production documents from a third account. You can assign, reassign, and remove scenarios whenever you want. A scenario can only be assigned to one email account at a time. The default email account will be used for all scenarios that aren't assigned to an account.
On the Email Scenario Assignment page, you can choose the Set Default Attachments action to add attachments to email scenarios. The attachments will always be available when you compose an email for a document related to the scenario. Each email scenario can have one or more default attachments. Default attachments are automatically added to emails for the email scenario. For example, when you send a sales order by email, the default attachment specified for the Sales Order scenario will be added. Default attachments display in the Attachments section at the bottom of the Compose an Email page. You can manually add non-default attachments to the email.
You can control the email messages that a user can access in the Email Outbox and Sent Emails pages.
On the User Email View Policies, choose a user, and then choose one of the following options in the Email View Policy field:
- View own emails - The user can view only their own email messages.
- View all emails - The user can view all email messages, including emails that were sent by other users.
- View if access to all related records - This view policy is used if no other policy is specified. A user can view email messages that other users sent if the user has access to the record that was sent and all of the related records. For example, User A sent a posted sales invoice to a customer. User B can see the email message if they have access to both the invoice and the customer.
- View if access to any related records - The user can view email messages that were sent by other people if the user has access to at least one record that is related to the record that was sent. For example, User A sent a posted sales invoice to a customer. User B can see the email message if they have access to either the invoice or the customer.
Note
If you leave the User ID field empty and then choose the Email View Policy action, the view policy applies to all users.
Some email providers (ISPs) limit the number of email messages an email account can send in one go, or within a certain amount of time, or both. Known as email throttling, the practice helps ISPs control traffic on their servers and prevent spam. If an email account exceeds the limit, the ISP might block the messages. To ensure that the number of messages that you send from [!INCLUDE prod_short] complies with your ISP's limit, specify the limit for each of your email accounts.
The default limit for the Microsoft 365 and Current User account types is 30, which matches the limit set by Exchange Online.
There are two ways to specify the limit:
- When you use the Set Up Email assisted setup guide to create a new account, specify the limit in the Rate limit per minute field.
- For existing email accounts, specify the limit in the Email rate limit field on the account.
You can use reports to include key information from sales, purchase, and service documents in texts for emails. Report layouts define the style and the content of the text in the email. For example, the content might include texts such as a greeting or instructions that precede the document information. This procedure describes how to set up the Sales - Invoice report for posted sales invoices, but the process is similar for other reports.
Note
To use the layout to create content for email messages, you must use the Word file type for your layout.
- Choose the
icon, enter Report Selections - Sales, and then choose the related link.
- On the Report Selection - Sales page, in the Usage field, select Invoice.
- On a new line, in the Report ID field, select, for example, standard report 1306.
- Select the Use for Email Body checkbox.
- Choose the Email Body Layout Description field, and then select a layout from the list.
- To view or edit the layout that the email text is based on, select the layout on the Custom Report Layouts page, and then choose the Export Layout action. If you customize the layout, use the Import Layout action to upload the new layout.
[!NOTE] To customize a standard report layout, such as 1306, you must make a copy of the report. [!INCLUDE prod_short] will help you create a copy when you import a custom layout for a standard report. The name of your new custom report layout will be prefixed with "Copy of."
- If you want to let customers use a payment service, such as PayPal, you'll need to set up the service. Afterward, the PayPal information and link are inserted in the email text. For more information, see Enable Customer Payments Through PayPal.
- Choose the OK button.
Now, when you choose, for example, the Send action on the Posted Sales Invoice page, the email body will contain the document information of report 1306 preceded by styled standard text according to the report layout that you selected in step 5.
If you're using the SMTP Connector extension, you can use the Send As or Send on Behalf capabilities from Microsoft Exchange to change the sender address on outbound messages. [!INCLUDEprod_short] will use the SMTP account to authenticate to Exchange, but will either replace the sender address with the one you specify, or amend it with "on behalf of."
When you set up an account and you want to use the Send As or Send on Behalf capabilities from Exchange, in the Sender Type field, choose Specific User.
Alternatively, you can choose Current User to allow people to send messages through the SMTP Connector. The message will appear to be sent from the email account specified in the Contact Email field on the User Card for the user they're signed in as. However, it will function similar to the Send As feature and will be sent from the account specified in the setup of the SMTP Connector.
The following are examples of how Send As and Send on Behalf are used in [!INCLUDEprod_short]:
- You might want the purchase or sales orders that you send to vendors and customers to appear to come from a noreply@yourcompanyname.com address.
- When your workflow sends an approval request by email using the email address of the requester.
Note
You can only use one account to substitute sender addresses. That is, you cannot have one substitute address for purchasing processes, and another for sales processes.
You can save time by setting up a preferred method of sending sales documents for each of your customers. You won't have to select a sending option, such as whether to send the document by email or as an electronic document, every time you send a document. For more information, see Set Up Document Sending Profiles.
Get more out of the communications between salespeople and your existing or potential customers. You can track email exchanges, and then turn them into actionable opportunities. Learn more at Track Email Message Exchanges Between Salespeople and Contacts.
Administrators can switch on the telemetry feature in [!INCLUDEprod_short] to get data about usage and failures of different capabilities in the system. For email, we log the following operations:
- An email was sent successfully
- An attempt to send an email failed
- Authentication to a SMTP server succeded/failed
- Connection to a SMTP server succeded/failed
You can use this data to monitor email usage and to troubleshoot email failures. Learn more at Analyzing Email Telemetry (administration content).
[!INCLUDEprod_short] on-premises can integrate with services that are based on Microsoft Azure. For example, you can use Cortana Intelligence for smarter cash flow forecasts, Power BI to visualize your business, and Exchange Online for sending email. Integration with these services is based on an app registration in Microsoft Entra ID. The app registration provides authentication and authorization services for communications. To use the email capabilities in [!INCLUDEprod_short] on-premises, you must register [!INCLUDEprod_short] as an app in the Azure portal, and then connect [!INCLUDEprod_short] to the app registration. The following sections describe how.
The steps to register [!INCLUDEprod_short] in Azure portal are described in Register an application in Microsoft Entra ID.
Note
To use the email features, your app registration must use a multi-tenant configuration.
The settings that are specific to the email capabilities are the delegated permissions that you grant to your app registration. The following table lists the minimum permissions.
API / Permission Name | Type | Description |
---|---|---|
Microsoft Graph / User.Read | Delegated | Sign in and read user profile. |
Microsoft Graph / Mail.ReadWrite | Delegated | Compose email messages. |
Microsoft Graph / Mail.Send | Delegated | Send email messages. |
Microsoft Graph / offline_access | Delegated | Maintain data access consent. |
Microsoft Graph / Mail.Send.Shared | Delegated | Shared Mailbox |
If you're using the SMTP Connector and want to use OAuth 2.0 for authentication, the permissions are slightly different. The following table lists the permissions.
API / Permission Name | Type | Description |
---|---|---|
Microsoft Graph / offline_access | Delegated | Maintain data access consent. |
Microsoft Graph / openid | Delegated | Sign users in. |
Microsoft Graph / User.Read | Delegated | Sign in and read user profile. |
Microsoft Graph / SMTP.Send | Delegated | Send emails from mailboxes using SMTP AUTH. |
Office 365 Exchange Online / User.Read | Delegated | Sign in and read user profile. |
When you create your app registration, note the following information. You'll need it to connect [!INCLUDEprod_short] to your app registration.
- Application (client) ID
- Redirect URI (optional)
- Client secret
Learn more about general guidelines for registering an app at Quickstart: Register an application with the Microsoft identity platform.
Note
If you have trouble using the SMTP protocol to send email after you connect [!INCLUDEprod_short] to your app registration, it might be because SMTP AUTH is not enabled for your tenant. We recommend that you use the Microsoft 365 and Current User email connectors instead, because they use Microsoft Graph Mail APIs. However, if you must use SMTP protocol you can enable SMTP AUTH. For more information, see Enable or disable authenticated client SMTP submission (SMTP AUTH) in Exchange Online.
Connect [!INCLUDEprod_short] to your app registration
After you register your application in Azure portal, in [!INCLUDEprod_short], use the Email Application Microsoft Entra ID Registration page to connect [!INCLUDEprod_short] to it.
- In [!INCLUDEprod_short], choose the
icon, enter Email Application Microsoft Entra ID Registration, and then choose the related link.
- Fill in the fields as necessary. [!INCLUDEtooltip-inline-tip]
Tip
Alternatively, if you are connecting for the first time, you can run the Set up email assisted setup guide. In this case, the guide will also include the Email Application Microsoft Entra ID Registration page for adding the information for connecting to your app registration.
Shared mailboxes in Exchange Online
[Work with [!INCLUDEprod_short]](ui-work-product.md)
[Setting Up [!INCLUDEprod_short]](setup.md)
Send Documents by Email
[Customizing [!INCLUDEprod_short] Using Extensions](ui-extensions.md)
[Use [!INCLUDEprod_short] as Your Business Inbox in Outlook](admin-outlook.md)
[Getting [!INCLUDEprod_short] on My Mobile Device](install-mobile-app.md)
[Getting [!INCLUDEprod_short] on My Mobile Device](install-mobile-app.md)
Analyzing Email Telemetry (administration content)
[!INCLUDEfooter-include]