App registration in Azure Portal. https://docs.microsoft.com/en-us/dynamics365/business-central/admin-how-setup-email
Given the right permission and have got the right client-id and client secret since the authentication has been verified.
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 (5)
User.Read Delegated Sign in and read user profile
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.
Grant consent has been given to all permissions in which it was required.
Please help me out!