In this article we will first discuss the features of built-in report emailing, and then we will focus on how Docentric AX improves report emailing and the Email print destination.
Built-in functionality: Use of E-mail parameters
In SSRS framework, built-in email functionality works in the following way:
1) When you run an SSRS report on demand, e.g. for the Customer Account Statement report you select the Email print destination and then execute the report, or for Purchase order you click the Use Print Management button and before that you set in the Print Management setup Email as the target print destination, then the report execution occurs on the client side. And in this case, in SSRS framework, your (i.e. the current user) MS Outlook application will be used for emailing reports, which means that Email parameters (Company/System administration/Setup/System -> E-mail parameters) will not be considered. You can check this logic in the SrsReportRunMailer class. This also means that you cannot change neither the sender email nor the sender display name, since the email and display name from the current user Outlook account will be used. And, in case that you are using Office365 (online email) you cannot email reports on the client side at all.
2) When you run an SSRS report on the server side (AOS), and that happens in AX only when report is executed in batch, or when some posting takes place (e.g. when you post & print Purchase order or Invoice), then SSRS framework will use the values set up in Email parameters (Company/System administration/Setup/System -> E-mail parameters) to email the report. (Of course, you can write your own logic to make report to execute on the server side without batch or posting).
There are two possibilities to configure these settings:
2a) If in E-mail parameters there is an account specified (fields User name and Password are set, and Use NTML is turned off), then for this login account the corresponding email account will always be used for all reports. Also, you cannot change sender email and display name – SSRS will always use the data linked to the specified login account.
2b) If in E-mail parameters the Use NTML option is turned on, then for current user and for all reports, his or her email account will be used and also his or her corresponding display sender name, which cannot be changed.
Docentric AX improvements
- You can select whether you want to send emails always via AOS (on the server side), also in the case when you run a report on demand (option (1) above). This is a cool feature if you have Office365, because you will be able to email reports on the client side as well, and also, performance will be much better. The Send emails always via AOS option can be set in Docentric reporting parameters.
- You can set the From email address in the Print destination settings form:
But there is a limitation related to the outgoing mail server configuration.The specified sender email address will be considered for using only if the currently used outgoing mail server allows the currently used user account to send emails from this address.
And what are the currently used outgoing mail server and the currently used user account?
For option (1) – when report is executed on the client side, which also means that the Send emails always via AOS option is turned off, the currently used user account is the current user account, and the currently used outgoing mail server is the one specified in the current user Outlook application.
For options (2a) and (2b), and also option (1) with the Send emails always via AOS option is turned on – when report is emailed on the server side, the currently used user account and the currently used outgoing mail server are specified in Email parameters.
For example, if option (2b) is active, then the current user credentials are used to login to the outgoing mail server specified in Email parameters, and if the current user account has permission to send emails on behalf of other accounts, e.g. email@example.com, then the current user can set up firstname.lastname@example.org as From email address in the Print destination settings form. And if the current user account does not have such permission, then the set From email address will be ignored and the current user email address will be used.
- If the configuration of your mail server does not allow you to set different sender email addresses, you can certainly set different sender display names – even per report; in AX 7 version also per report per company. For example, you can use the same sender email address for sending all reports (using the option (2a), e.g. email@example.com) and apply different sender display names for different reports (e.g. Docentric HR Department, Docentric Services, E-invoice Docentric,…).
- You can specify additional settings for SMTP client – this is a technology used for sending emails via AOS (e.g. Enable SSL is very important one).
- Improvements of the Email print destination: Open email before sending; using placeholders in email body, subject, attachment name; support for HTML body; support for additional attachments. Read more in this article.