Email Connectors Overview
Erik's ToolBox adds three email connectors to Business Central's standard email framework, so you can send email through modern, API-based providers without SMTP. Each connector plugs into the built-in Email Accounts page as a new account type and, once configured, behaves like any other Business Central email account — usable by email scenarios, document sending, and the Email / Email Message codeunits from ToolBox AL scripts.
The Three Connectors
| Connector | Sends through | Authentication | Best for |
|---|---|---|---|
| Microsoft Graph | A Microsoft 365 mailbox via the Microsoft Graph API | Entra ID app registration (client credentials, Mail.Send) |
Sending from a Microsoft 365 user or shared mailbox |
| Google Workspace | A Google Workspace mailbox via the Gmail API | Service account with domain-wide delegation | Sending as a Google Workspace user |
| Moosend | The Moosend (Sitecore Send) transactional API | A single API key | Transactional email through Moosend |
All three authenticate as an application — no interactive user login is involved — which makes them well suited to unattended sending from Business Central.
Adding a Connector Account
The connectors register themselves as values on the standard Business Central Email Connector enum, so they appear in the normal account-creation flow:
- Search for Email Accounts and choose Add an email account.
- Pick one of the ToolBox connectors:
- Microsoft Graph (ToolBox)
- Google Workspace (ToolBox)
- Moosend (ToolBox)
- The connector's account card opens. Fill in the fields (see the connector-specific page),
then use the card actions to verify the setup.
Each account card provides three actions:
| Action | What it does |
|---|---|
| Setup Guide | Opens an in-product, step-by-step configuration guide for that connector. |
| Test Connection | Authenticates against the provider and reports what it finds, without sending mail. |
| Send Test Email | Sends a message from the account to itself — the definitive end-to-end proof. |
An account only becomes usable by the email framework once every required field (and its stored secret) is present.
How Secrets Are Stored
Sensitive credentials — the Microsoft Graph client secret, the Google service account private key, and the Moosend API key — are never written to the database. They are held in Business Central IsolatedStorage (module scope), keyed by the account's id, and removed automatically when the account is deleted. The account table stores only the non-secret identity fields (account name, sender address, tenant/client id, and so on).
The "Enabled" Mode (Test-Environment Safety)
Every connector account has an Enabled field that controls its send behavior. This is especially useful in sandboxes and test environments, where you want to exercise email flows without actually delivering mail to real recipients.
| Mode | Behavior |
|---|---|
| Enabled | Normal sending. |
| Enabled (No Sending) | Messages are accepted and marked as sent, but nothing leaves Business Central. |
| Enabled (Redirect) | Every message is sent to the Redirect Email Address instead of its real recipients; Cc and Bcc are dropped. The stored/queued message keeps its original recipients — only the outgoing copy is redirected. |
| Disabled | The account is hidden from the account list and queued sends fail. |
When you choose Enabled (Redirect), fill in the Redirect Email Address on the card; otherwise sending errors with a clear message. Switching modes needs no change to the provider credentials, so you can flip a production-shaped account into no-sending or redirect mode for testing and back again.
Using a Connector Account from ToolBox AL
Once an account is configured and set as a default (or selected in an email scenario), scripts can send through it with the standard Email and Email Message codeunits:
var
Msg: Codeunit "Email Message";
Mail: Codeunit Email;
begin
Msg.Create('customer@example.com', 'Invoice', '<p>Your invoice is attached.</p>', true);
if Mail.Send(Msg) then
Message('Sent through the configured connector');
end;