Sending Mail-copy-820

Email documents directly from Business Central using custom setups.

Updated at November 12th, 2025

Email documents directly from Business Central using custom setups.

Module Description

This module allows you to make default settings for sending documents by email.

The information that can be entered is:

  • Different recipients for each document type on the customer or supplier database
  • Texts for the subject and body of the email, generic for each type of document or dedicated to a single customer / supplier
  • Default attachments, in addition to the PDF of the document, automatically attached, for all shipments of a specific type of document or set for a single email shipment

When sending the email from the document, the default settings can be changed.

This documentation focuses on the active side, but the functionality is mirrored on the supplier side.

Setup

Email Account

To send emails correctly, you need to set up all your sending email accounts.

You then need to open the Email Accounts page from the menu:

Here you need to enter all the senders that can be used (in subsequent setups) for sending emails with the corresponding server settings:

* Attention, it is always necessary to first carry out a system analysis on the customer's mail server infrastructure to understand how best to carry out the setup

 

Recipients with contact management

By opening the customer database, you can indicate which contacts are recipients of emails for each document type.

Then select Related – Customer – Link email to contacts :

A page will open showing all the contacts linked to the selected customer with their email addresses.

Using the flags on the right, you can select the recipient of the email for each type of document:

It is also possible to indicate more than one recipient for a single document type; these will be automatically linked.

This selection will automatically populate the Doc. Mail Addresses table:

Here you can indicate any CC and BCC or identify different recipients for different shipping addresses (for example for shipments).

Recipients without contact management

If contact records are not managed, it is possible to directly manage recipient addresses, CC and BCC directly in the Mail Doc. Addresses table present in the customer record:

Here you can indicate:

  • Table ID: indicates the document table from which the email originates
    36 → provisional sales documents
    38 → provisional purchase documents
    110 → recorded sales shipping
    112 → registered sales invoice
    114 → registered sales credit note
    6650 → Registered purchase return shipments
  • Document type: to be indicated only for temporary documents (tables 36 and 38).
    0 on offer
    1st order
    2nd invoice
    3 credit note
    4th scheduled order
    5th return order
  • From Address: sender of the email (see Paragraph 2.5 )
  • Send to: recipient of the email, if there is more than one you can insert all the addresses with a ; for concatenation
  • Send CC: Copy email addresses, here too you can link more than one address
  • Send BCC: blind carbon copy email addresses, here too you can chain more than one address
  • Ship to / Order Address Code: If the recipients have different shipping addresses, you can indicate it here. 

Setup mail text notification

The default email body and subject text settings are to be made in the Notification Text Mail Setup list, searchable in the menu.

For each type of document for which you want to manage email sending, you need to insert a line within this setup, maintaining the same logic described in paragraph 2.3 .

The fields to be indicated are:

  • Table ID: indicate the header of the document to be sent.
  • Table subtype: for temporary documents it is also necessary to indicate the document type
  • Customer / Supplier: indicate whether the management is related to a customer or supplier
  • Customer/Supplier No.: If you want to manage a different setup for each customer, you can enter multiple lines for the same document type by specifying the specific customer code in this field. If this field is left blank, the default setting will be used.
    The setup with the specific master data will always prevail over the default one.
  • Notification Text Code: Indicates the text for the subject and body of the email
  • Report setup: you can specify a print template for the report of the sent document.
  • Sender's email: indicate the sender for the specific document/personal data 

Notification texts

To enter a notification text, search the list from the menu or go to the Setup Mail Notification Texts list field.

The list shows all the entered texts.

Use the New function to insert a new one.

In the general tab indicate:

  • Code and description: indicative for text recognition
  • Mail Body Type : Allows you to indicate the text writing type, choosing between Text Lines and HTML
  • Language code and All language codes: indicate the text management language in the Language code field. If the text you are inserting is the default text, you can leave the language code = '' and set the All language codes field.
  • Table ID and Type Table Option: indicate the starting table and the document type (for provisional documents) as in paragraph 2.3 .
  • Start Date and End Date: Specify dates to limit the use of the text
  • Subject: Enter the subject of the email here. You can use placeholders.
  • Attachment: in the 4 attachment fields you can insert default attachments that will be sent every time this type of document is sent.

Instead, you can insert the email text into the lines or HTML formatting.

Placeholders can also be inserted here.

In the Values and Company Information tabs, you can insert fields that will replace the subject and body placeholders. The fields you can choose from will be those from the table specified in the Table ID field for the Values section, while in the Company Information tab, they are related to the company information table:

Image containing text, document, parallel, number  AI-generated content may be incorrect.

Senders

There are several ways to set the email sender.

In ascending order of priority:

  • Default Email Account
    If no other sender is specified in the other setups, the system will always use the user set as default in the E-Mail Accounts list.
    In this case, you can leave the Sender field in the Mail Doc Addresses table blank.
  • Mail Setup Text Notification
    The sender address entered here is always used to send that type of document and always takes precedence over the default address set in the email accounts.
    Only encrypted email accounts can be entered in this field.
  • Email Doc Addresses.
    It is never used at the moment.

Functionality

The email sending action is present on the list and tab of all documents.

Both functions will propose the default settings set for setup, senders, recipients and texts, from here the customer will be able to modify the necessary data.

Sending from a document tab allows you to send only the open document.

From the document list, you can send a single document or multiple documents using multiple selection.

In both cases the submission methods will be the same.

From both the list and the tab, select the Send Mail function:

Image containing text, number, character, or line  AI-generated content may be incorrect.

Image containing text, screenshot, number, character  AI-generated content may be incorrect.

In both cases, a screen will open showing all the default settings found by setup:

Image containing screenshot, text, or line  AI-generated content may be incorrect.

Here you can edit any text and all addresses, sender, recipient, CC and BCC.

In the Attachments sidebar, you can insert additional attachments for this single submission only.

The attachments included here are to be considered additional to the PDF of the selected document (report taken from the relevant Report Selection ) and to those included in the email text used for sending.

To attach documents, click on the calculated field on the right that indicates the number of attachments currently present and then select the file:

Image containing text, screenshot, or line  AI-generated content may be incorrect.

Image containing screenshot, text, or software  AI-generated content may be incorrect.

Instead, using the Show Preview function, you can view the subject and text of the email as it would appear within the email itself and, if necessary, modify it:

Preview with Text Lines

Image containing screenshot, text, or software  AI-generated content may be incorrect.

Preview with HTML

To send the email, use the Send function:

Image containing text, screenshot, line, character  AI-generated content may be incorrect.

If the email fails to send due to system issues, this will be displayed in the Last Error field and the line will remain marked as Not Sent .

If the problem is related to the email itself, the standard delivery failure email will be sent to the sender:

Image containing text, Character, screenshot  AI-generated content may be incorrect.

If the email is sent successfully, the Mail Sent flag will be set on the document so that you can see at a glance whether the document has already been sent or not:

Image containing text, screenshot, software, web page  AI-generated content may not be correct.

The email will look like this, if it was filled in using the Text Lines option:

While it will look like this in case the HTML option was selected:

Attached documents will include:

  • When printing the sent document, in the case of customer- or supplier-specific layouts, this will be retrieved from the standard "Document Layout" table linked to the master data. For all other layouts, the basic report will be attached.
  • All added attachments inserted before sending.

In the case of multiple submissions, the submission procedure is the same.

The submission page in this case will have not a single record, but as many records as the documents selected:

Image containing text, screenshot, number, character  AI-generated content may be incorrect.

Image containing screenshot, text  AI-generated content may be incorrect.