Skip to main content
Business Central forum
Suggested answer

When using current user e-mail functionality in Business Central On-Prem, error 'Access denied. Check Credentials and try again.'

editSubscribe (0) ShareShare
ReportReport
Posted on by 5
  1. App registration in Azure Portal. https://docs.microsoft.com/en-us/dynamics365/business-central/admin-how-setup-email

  2. Given the right permission and have got the right client-id and client secret since the authentication has been verified.

154708_2D00_image.png

  1. However, when sending out a e-mail by user an error pops up that the 'Access is denied. Check credentials and try again.'

Below the given permissions:
Dynamics 365 Business Central (1)
API.ReadWrite.All Application Full access to web services API

Microsoft Graph (4)
User.Read Delegated Sign in and read user profile.
Mail.ReadWrite Delegated Compose email messages.
Mail.Send Delegated Send email messages.
offline_access Delegated Maintain data access consent.

Categories:
  • AleRiv Profile Picture
    AleRiv 5 on at
    RE: When using current user e-mail functionality in Business Central On-Prem, error 'Access denied. Check Credentials and try again.'

    Hello alepil,

     we ran into the same issue with D365BC 19.3 and we managed to solve it by updating to BC 19.6

  • alepil Profile Picture
    alepil 5 on at
    RE: When using current user e-mail functionality in Business Central On-Prem, error 'Access denied. Check Credentials and try again.'

    Hello Marco,

    I've tried to update redirect and secret password but nothing changed.

    Thaht is the error from Event Viewer:

    The description for Event ID 701 from source MicrosoftDynamicsNavServer$BC190 cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

    If the event originated on another computer, the display information had to be saved with the event.

    The following information was included with the event:

    Server instance: BC190

    Category: Email

    ClientSessionId: 0a0838f9-db1b-4f08-89c6-bd2984534449

    ClientActivityId: e592efbf-99d7-9f47-933b-1f34ac882c52

    ServerSessionUniqueId: fe2784d6-566b-4a8a-82d3-d44b4a33db87

    ServerActivityId: e4bd303e-fd91-43a9-b8ec-87c7e8db8ee6

    EventTime: 04/13/2022 07:39:52

    Message Could not send the email {3E85BB83-0B43-4F8E-B70B-198B6DAF0B98} because of the following error: Use ERROR with a text constant to improve telemetry details. Call stack: "Email - Outlook API Client"(CodeUnit 4508).ProcessErrorMessageResponse line 4 - Email - Outlook REST API by Microsoft\"Email - Outlook API Client"(CodeUnit 4508).SendMailSingleRequest - Email - Outlook REST API by Microsoft\"Email - Outlook API Client"(CodeUnit 4508).SendEmail - Email - Outlook REST API by Microsoft\"Email - Outlook API Helper"(CodeUnit 4509).Send line 11 - Email - Outlook REST API by Microsoft\"Current User Connector"(CodeUnit 4500).Send line 4 - Email - Current User Connector by Microsoft\"Send Email"(CodeUnit 8890).OnRun(Trigger) line 8 - System Application by Microsoft\"Email Dispatcher"(CodeUnit 8888).OnRun(Trigger) line 30 - System Application by Microsoft\"Email Impl"(CodeUnit 8900).Send line 42 - System Application by Microsoft\"Email Impl"(CodeUnit 8900).Send line 2 - System Application by Microsoft\"Email Editor"(CodeUnit 8906).SendOutbox line 7 - System Application by Microsoft\"Email Editor"(Page 13)."Send - OnAction"(Trigger) line 8 - System Application by Microsoft\.

    ProcessId: 7932

    Tag: 0000CTP

    ThreadId: 61

    CounterInformation:

    CustomParameters: {"Connector": "Current User","EmailMessageID": "3E85BB83-0B43-4F8E-B70B-198B6DAF0B98","EmailAccountID": "3199B20B-A19A-4467-9484-B9DF25C64ABB","Category": "Email","ErrorText": "Use ERROR with a text constant to improve telemetry details","ErrorCallStack": "\"Email - Outlook API Client\"(CodeUnit 4508).ProcessErrorMessageResponse line 4 - Email - Outlook REST API by Microsoft\\\"Email - Outlook API Client\"(CodeUnit 4508).SendMailSingleRequest - Email - Outlook REST API by Microsoft\\\"Email - Outlook API Client\"(CodeUnit 4508).SendEmail - Email - Outlook REST API by Microsoft\\\"Email - Outlook API Helper\"(CodeUnit 4509).Send line 11 - Email - Outlook REST API by Microsoft\\\"Current User Connector\"(CodeUnit 4500).Send line 4 - Email - Current User Connector by Microsoft\\\"Send Email\"(CodeUnit 8890).OnRun(Trigger) line 8 - System Application by Microsoft\\\"Email Dispatcher\"(CodeUnit 8888).OnRun(Trigger) line 30 - System Application by Microsoft\\\"Email Impl\"(CodeUnit 8900).Send line 42 - System Application by Microsoft\\\"Email Impl\"(CodeUnit 8900).Send line 2 - System Application by Microsoft\\\"Email Editor\"(CodeUnit 8906).SendOutbox line 7 - System Application by Microsoft\\\"Email Editor\"(Page 13).\"Send - OnAction\"(Trigger) line 8 - System Application by Microsoft\\"}

    GatewayCorrelationId:

    The message resource is present but the message was not found in the message table

  • Suggested answer
    Marco Mels Profile Picture
    Marco Mels on at
    RE: When using current user e-mail functionality in Business Central On-Prem, error 'Access denied. Check Credentials and try again.'

    Hello,

    You may want to verify if in the Assisted Setup window, the correct secret / application ID is filled in. You also need to ensure that the reply url is correct. This is Assisted Setup, Azure AD settings.

    We have had a few cases where the secret was not correctly stored hence the error. Recreating the secret could resolve these issues.

    But feel free to raise it to support via your partner or CSP. Make sure you have the application event log file in evtx format, navsettings.json file, customsettings.config file and the azure AD app registration as we will probably ask for it (at least I would need to verify these logs).

    Thank you.

  • alepil Profile Picture
    alepil 5 on at
    RE: When using current user e-mail functionality in Business Central On-Prem, error 'Access denied. Check Credentials and try again.'

    Hello,

    Thank you for your reppy.

    The current user and his email address are automatically and correctly set up 

    pastedimage1649750330787v2.png

  • Suggested answer
    Marco Mels Profile Picture
    Marco Mels on at
    RE: When using current user e-mail functionality in Business Central On-Prem, error 'Access denied. Check Credentials and try again.'

    Hello,

    That looks like the correct permissions were given to the user. Does it fail for another user as well? We sometimes see that an entry in the Token Cache table for the user is in error preventing a successful authentication flow. Is the mail address showing for the Current User account or is it blank (no mail address shown)?

    Thank you.

Helpful resources

Quick Links

What Motivates a Super User?

We know many of you visit the Dynamics 365 Community and Power Platform…

Demystifying Copilot with Georg Glantschnig…

Industry experts answer burning questions directly from our amazing Community…

Setting Up Knowledge Sources for Copilot…

Look at how configuring a comprehensive knowledge base is crucial…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,045 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 222,570 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,138

Product updates

Dynamics 365 release plans