Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Unanswered

SMTP Setting error

Posted on by 764
Dear All,
 
I got the following error on SMTP setting despite all the effort i done available on doc. any help.  I also rechecked the account setting in manage email app. Any help.
 
 
  • John Wainwright Profile Picture
    John Wainwright 12 on at
    SMTP Setting error
    Afazal,
     
    I have no idea what your organization's infrastructure is, or how your Office365 users/email, or your D365 users are configured. That said - try this...you might have better luck.
     
    - DON'T use SMTP. Use Exchange instead. This will then just send as (and authenticate) as whomever is the user logged into D365 at the time.
     
     
    Leave all of this stuff blank.
     
     
     
    Instead, on the Configuration tab select Exchange as the Batch email provider, and also as the only Enabled interactive email provider.
     
     
     
    When you send a Test email, it will just use whatever Sender is associated with the user logged into D365 at that time sending the email.
     
     
     
    Assuming the Sender email associated with the logged in user is a valid Office365 user with an active mailbox...then D365 will authenticate with Exchange without the need for a separate SMTP authentication.
     
     
    You may have better luck with this method, as opposed to SMTP.
     
     
     
     
     
  • John Wainwright Profile Picture
    John Wainwright 12 on at
    SMTP Setting error
    Afazal,
     
    I'm not sure what you mean by app password vs. email password. Have you directly created a D365 user as opposed to importing a user from Active Directory, so that you're using Microsoft Single-Sign On? (More on this in a minute.)
     
    In the D365 SMTP settings, the User/Password you provide should be the User/Password of the Office365 Email Account. This doesn't have to even be a (Office 365 User) that has a user in D365. This is the user that will be authenticating with the SMTP Server.
     
    You could be using smtp.sendgrid.net, and a SendGrid user. It's the user allowed to authenticate in whoever is the SMTP service provider.
     
     
     
     
    Please keep in mind, Microsoft is deprecating non-Active Directory users in March 2024. Best practice is to create D365 users via import from AD.
     
     
     
     
     
     
    In any case, the SMTP Authentication credentials you provide - are those of the "email account". When it authenticates, it's trying to authenticate through Office365 - same as if you were to try to log into Outlook on the web.
     
    In my example, I used my own email account - but it was just an example. This email account is MFA enabled. The only reason my test worked, is because I also "happen to be" logging into D365 as that same user - so, I passed MFA authentication when I logged into D365. That MFA-authenticated session was still active when I hit the test button.
     
    IF...I had provided SMTP Authentication credentials for my MFA-enabled user, but then logged into D365 with some other account - when I hit the test button, it would have failed. Because...how is D365 going send a test email and then MFA-authenticate in that session? It can't.
     
    The SMTP Authentication credentials you provide need to be for an account that is going to be able to successfully authenticate for anyone in D365 who may be sending an email, therefore - if you're going to use an Office365 mail account, it should not be MFA enabled. As I mentioned previously as well - Send As and Send on Behalf Of permissions will need to be provided for any accounts that may be sending an email from D365.
     
    Understand that sending an email from D365 has a slightly different series of events than you sending from Outlook.
     
    You sending an email from Outlook:
     
    D365 sending an email email from D365:
    • D365 User Sally@company.com posts a vendor payment, and the payment advice Print Management report specifies that it's delivered to the vendor as a PDF attachment in an email.
    • An email FROM Sally@company.com is created, TO vendor@vendor.com.
    • Even though the email is "from" the email address on Sally's account, D365 is sending it through the SMTP server - by authenticating as afazal@company.com - because that's the account you specified as the SMTP Server credentials.
    • afazal@company.com should not be MFA-enabled, as there would be no way for Sally or D365 to pass MFA.
    • Sally@company.com will need to have Send As / Send on Behalf Of enabled for afazal@company.com - so that Office365's mail server knows that it's ok for afazal to authenticate the SMTP server, with an email that is coming "from" someone else.
     
     
     
     
  • Afazal Profile Picture
    Afazal 764 on at
    SMTP Setting error
    Did you use app password for email account or email password. My account is MFA enabled. I am using app password, but no luck.
    I follow all instructions you mentioned and also i enabled Authenticated SMTP in mail box, but no luck.
  • John Wainwright Profile Picture
    John Wainwright 12 on at
    SMTP Setting error
    Azfal,
     
    Then your settings within D365 are correct. I believe the issue is likely because the email account you are using does not have SMTP Auth enabled on the Office365 mailbox itself. (Microsoft disables this by default.)
     
     

    Enable SMTP AUTH for specific mailboxes

    The per-mailbox setting to enable (or disable) SMTP AUTH is available in the Microsoft 365 admin center or Exchange Online PowerShell.

    Use the Microsoft 365 admin center to enable or disable SMTP AUTH on specific mailboxes

    1. Open the Microsoft 365 admin center and go to Users > Active users.

    2. Select the user, and in the flyout that appears, click Mail.

    3. In the Email apps section, click Manage email apps.

    4. Verify the Authenticated SMTP setting: unchecked = disabled, checked = enabled.

    5. When you're finished, click Save changes.

     
     
     
     
    With SMTP Auth enabled on the Office365 Mailbox account itself, you should see test results such as these...
     
     
     
     
     
     
     
     
     
     
  • Afazal Profile Picture
    Afazal 764 on at
    SMTP Setting error
    John,
     
    I entered the same account in both email parameter and in the user account logged in d365.
     
    But same issue exist.
     
    I gone through the docs you mentioned but i don't understand what is ment by Send As/Send On Behalf Of permission.
     
  • John Wainwright Profile Picture
    John Wainwright 12 on at
    SMTP Setting error
    Atfab,
     
    The settings you have (on face value) are correct, however - it's important to also remember that emails coming "from" D365FO will not necessarily be from the email address you enter as the SMTP authentication. 
     
    So - let's say in the SMTP authentication, you've provided EmailAdmin@mycompany.org as the authenticating user. When you do a test email, or a system email is actually sent, the email may be coming from one of two possible other email addresses.
     
    If it's an email that uses an Organization or System Email Template, such as a Workflow notification, the "FROM" is defined in that template. Maybe it's PURCHASING@mycompany.org. If it's just me interactively emailing a report to someone, it may be coming from my own email address JOHN@mycompany.org, which is associated with my logged on D365 user. I believe the SMTP "test" functionality uses the latter - whatever user you're logged in as.
     
    So - it's trying to send an email, as YOU (whatever email is associated with your D365 logged on user) - through that SMTP auth user - EmailAdmin@mycompany.org. (via Send As, or Send on Behalf Of)
     
    For this reason, any account that may be sending an email from D365, must have granted the EmailAdmin@ account (whatever account is in the SMTP settings) Send As/Send On Behalf Of permission.
     
     
    If authentication is required, specify the appropriate mail account to send email from. All users need to provide the SMTP account Send As and Send On Behalf Of permissions to enable the ability to send SMTP mail. You can configure Send As permissions in the Microsoft 365 admin center (portal.office.com/Admin) at Users > Active users > User > Edit mailbox permissions > Send email from this mailbox. For more information, see Enable sending email from another user's mailbox in Microsoft 365. (https://learn.microsoft.com/en-us/microsoft-365/admin/add-users/give-mailbox-permissions-to-another-user)
     
    Hope this helps.
     

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans