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

Community site session details

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

SMTP Mail Setup with MFA not working with O365

(0) ShareShare
ReportReport
Posted on by 348

BC_5F00_email_5F00_couldnt_5F00_be_5F00_sent.jpg

When testing SMTP Mail Setup in BC, I get the error message above in the screen shot: "The email couldn't be sent. Check your email setup. If you turned on multi-factor authentication for the mail address you might need to set up an app password." The technical details of the error are below.


"The mail system returned the following error: "A call to MailKit.Net.Smtp.SmtpClient.Authenticate failed with this message: 5.7.3 Authentication unsuccessful [MN2PR01CA0037.prod.exchangelabs.com]"."

Okay, so i log into Office.com/Admin and reset my MFA. It give me a new app password. Then I try to plug in the app password in the Password field, but as I tab out, it seems to change back to my regular O365 password.

I have the same question (0)
  • Suggested answer
    Marco Mels Profile Picture
    on at
    RE: SMTP Mail Setup with MFA not working with O365

    Hello,

    First of all: please do not share any PII data in either written text or screenshot in this community.

    Did you enable MFA via a conditional policy in Azure? App passwords generates this way are not compatible with D365 BC / Dyn NAV. If you did, then it must be disabled. If you did not it that way, then go to the user via Office 365 and edit the properties. Go to MFA setup which will redirect you to:

    account.activedirectory.windowsazure.com/.../MultifactorVerification.aspx

    Select the user and select Manage User Setting and select the three options.

    In the Azure AD portal, you can also edit the user and get to the MFA properties. Here you can revoke MFA sessions:

    pastedimage1584504569644v2.png

    This will allow you to recreate the App password after revoking MFA sessions, etc. It can take up to 30 minutes before the app password do work in MSDyn365 BC.

    Let us know how it does go. Thanks.

  • Steve Simon Profile Picture
    348 on at
    RE: SMTP Mail Setup with MFA not working with O365

    Marco, thank you for correcting me with the PII. I'll be more careful.

    Meanwhile I have followed your instructions to Manage User Settings: Require ... to provide contact methods again; Delete all existing app passwords; Restore MFA on all remembered devices.

    I go through the process and have my Authenticator App approve it. Then it creates an App Password. I then logged back into Office.com where I was asked for Additional Information. Then approved a message on my Authenticator App; and was duly logged in.

    Then I waited longer than a half hour to sign into BC (incognito - so I could replace the normal request for a password with my newly created App Password.). Microsoft won't accept the App Password.

    So I go back to Office.com and turn off MFA. Log out and then log in; turn it back on; delete and recreate user settings again; create a new app password; wait an hour and try to log into home.dynamics.com with an app password instead of the usual password. Failed again.

    Now I will try no MFA and see if SMTP mail works in BC. If so, I will try conditional MFA.

  • Steve Simon Profile Picture
    348 on at
    RE: SMTP Mail Setup with MFA not working with O365

    After you read my long reply below, showing my inability to use MFA with SMTP mail in BC, I turned MFA off. Checked the Reason Box as doesn't work with other applications. Now SMTP mail works great in BC.

  • Steve Simon Profile Picture
    348 on at
    RE: SMTP Mail Setup with MFA not working with O365

    I attempted MFA with conditional access, but my Azure license is only Basic. It says I need Premium P1 or P2. So I turned MFA off, so I can use SMTP Mail in BC.

  • Verified answer
    Olister Rumao Profile Picture
    3,967 on at
    RE: SMTP Mail Setup with MFA not working with O365

    Hi Steve,

    Thanks for all the tries, we do learn from you as well :).

    AFAIK, MFA wont be supported in SMTPMail setup because, the underlying code uses the Username Password combination to trigger an email from Business Central.

    SMTP-Mail.png

    Still I hope if some how you can add Business Central App as an exception for MFA in Azure.

    Also, you can suggest this idea to Microsoft through submitting your idea here https://experience.dynamics.com/ideas


    Hope this helps!

  • Suggested answer
    Marco Mels Profile Picture
    on at
    RE: SMTP Mail Setup with MFA not working with O365

    Hello,

    If the D365 BC application does not accept the app password, it usually is that one of the Azure policies is enabled. The app passwords generated via Azure policies are not compatible with what is needed in MSDyn365 BC. The only reason one would want to use these premium licenses (in relation to this topic) is that you can assign it to your users but also exclude users from the policy.. These users can then get the the MFA assigned on a per user base. Even with these premium licenses, the app passwords will not be be compatible. 

    You will have to disable the conditional policies from Azure portal and assign MFA via Office 365 portal. There are no workaround for this and it is also very unlikely that an idea will make this change.

    Thanks.

  • Steve Simon Profile Picture
    348 on at
    RE: SMTP Mail Setup with MFA not working with O365

    Thank you, Olister. I have given up trying to get MFA to work with SMTP emails. As you point out the underlying BC code doesn't take into account an App Password. I will post a suggestion to Microsoft.

  • kjjson Profile Picture
    on at
    RE: SMTP Mail Setup with MFA not working with O365

    I am having the same issue in a "demo" environment I have setup. I don't see where MFA is enabled and all my users are "Disabled" for MFA. Is there something else I am missing why I woul dbe getting this same error?

  • Steve Simon Profile Picture
    348 on at
    RE: SMTP Mail Setup with MFA not working with O365

    Dear kjjson, I am still flummoxed about this problem. I have MFA working with the Microsoft Authenticator just fine. Just that I still can't get app passwords to work for any Microsoft app, such as O365 or Business Central. I need it for BC, because the SMTP mail doesn't function. If you read the whole thread you will see the problems. Meanwhile, here is the link to set up App Passwords:

    docs.microsoft.com/.../admin-how-setup-email

    I did note that App Passwords are not recommended for Admins. Perhaps you could create a non-Admin login and set an App Password for it?

    Good luck.

  • aluzaja178 Profile Picture
    102 on at
    RE: SMTP Mail Setup with MFA not working with O365

    I am facing same error. I have followed this thread and did following steps:

    1. Create a non-admin user (With Office 365 and BC License )

    2. Created App Password for it.

    3. Tried it in BC mail setup and got no luck.

    Can anybody point me in a right direction here what i am doing wrong ?

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 4,327

#2
Sumit Singh Profile Picture

Sumit Singh 2,734

#3
Nimsara Jayathilaka. Profile Picture

Nimsara Jayathilaka. 2,599

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans