web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Where does Sender Email Address come from in Business Central V14 On-Prem?

(0) ShareShare
ReportReport
Posted on by 891

Where does the Sender Email Address come from in Business Central V14 On-Prem (Version: Platform 14.0.29530.0 + Application 29537 (GB Dynamics NAV 14.0))?

I think it looks in the User's contact email address, but does it also look somewhere else? We're finding it varies.

I have the same question (0)
  • Suggested answer
    Marco Mels Profile Picture
    on at

    Hello,

    How did you configure the SMTP Server in BC140? Otherwise, take a look here:

       LOCAL PROCEDURE QualifyFromAddress@2();

       VAR

         TempPossibleEmailNameValueBuffer@1000 : TEMPORARY Record 823;

         MailForEmails@1001 : Codeunit 397;

       BEGIN

         OnBeforeQualifyFromAddress(TempEmailItem);

         IF TempEmailItem."From Address" <> '' THEN

           EXIT;

         MailForEmails.CollectCurrentUserEmailAddresses(TempPossibleEmailNameValueBuffer);

         IF GraphSupported THEN

           IF AssignFromAddressIfExist(TempPossibleEmailNameValueBuffer,'GraphSetup') THEN

             EXIT;

         IF SMTPSupported THEN BEGIN

           IF AssignFromAddressIfExist(TempPossibleEmailNameValueBuffer,'SMTPSetup') THEN

             EXIT;

           IF AssignFromAddressIfExist(TempPossibleEmailNameValueBuffer,'UserSetup') THEN

             EXIT;

           IF AssignFromAddressIfExist(TempPossibleEmailNameValueBuffer,'ContactEmail') THEN

             EXIT;

           IF AssignFromAddressIfExist(TempPossibleEmailNameValueBuffer,'AuthEmail') THEN

             EXIT;

           IF AssignFromAddressIfExist(TempPossibleEmailNameValueBuffer,'AD') THEN

             EXIT;

         END;

         IF TempPossibleEmailNameValueBuffer.ISEMPTY THEN BEGIN

           IF FileManagement.IsWebClient THEN

             ERROR(FromAddressWasNotFoundErr);

           TempEmailItem."From Address" := '';

           EXIT;

         END;

         IF AssignFromAddressIfExist(TempPossibleEmailNameValueBuffer,'') THEN

           EXIT;

       END;

    Hope it helps.

  • Nick Webb Profile Picture
    891 on at

    Thanks for pointing me in the right direction. Here are my findings :-

    It trawls around building a list of possible email addresses.

    If the User ID field in the 'SMTP Mail Setup' page is an email address, it adds it to the list

    If Graph is enabled it adds value "Graph Mail Setup"."Sender Email" to the list

    If current user has an entry in "User Setup" add value from field "E-Mail" to the list

    If the "Contact Email" field has a value in the current user's User Card it's added to the list.

    If the "Authentication Email" field has a value in the current user's User Card it's added to the list.

    If the environment is not SaaS, it calls a procedure called TryGetEmailAddressFromActiveDirectory. I can't see the code for this. It's hidden DotNet code, but the name is self-explanatory.

    Having compiled the list, it then uses the following priority order

    1. Graph
    2. SMTP Mail Setup
    3. User Setup
    4. Contact Email
    5. Authentication Email
    6. Active Directory

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,229

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,867 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,153 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans