Skip to main content

Notifications

Small and medium business | Business Central, N...
Suggested answer

SMTP connection error while sending an email from BC OnPrem Version 25, 24

Posted on by 21,065 Super User 2024 Season 1
Hi,
Today I am facing one unique error while creating an email account in BC OnPrem Version 25, while I have already tested this email account and send in BC OnPrem 24 as well and facing same error there.
 
Could not connect to the SMTP server.

An error occurred while attempting to establish an SSL or TLS connection.

The server's SSL certificate could not be validated for the following reasons:
• The server certificate has the following errors:
• The revocation function was unable to check revocation for the certificate.
 
Above error is coming while I am using SMTP connection and sending any email using Test email or compose email,  as per below image is the setup I did, and I am facing this error ONLY IN BC ONPREM ANY VESION, while I have tested this email account in SaaS and Docker its perfectly fine no issue.
 
Categories:
  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,065 Super User 2024 Season 1 on at
    SMTP connection error while sending an email from BC OnPrem Version 25, 24
    Hello All,
     
    for you information I sucessfully resolved this issue by just turning off SMTP scanning in my local installed antivirus software.
     
  • Nitin Verma Profile Picture
    Nitin Verma 21,065 Super User 2024 Season 1 on at
    SMTP connection error while sending an email from BC OnPrem Version 25, 24
    Hi Saif,
     
    Its not related to Shopify, Its related to Email Setup I am doing and then sending test email either Gmail or any other domain in onPrem Version.
  • Suggested answer
    Saif Ali Sabri Profile Picture
    Saif Ali Sabri 231 on at
    SMTP connection error while sending an email from BC OnPrem Version 25, 24
    It sounds like you're encountering a mapping error between Shopify and Business Central (BC) after editing an order. 
    1. **Check Product Mapping:** Ensure that the product you replaced in Shopify is properly mapped in Business Central. If the new product does not exist or is not correctly set up in BC, it could cause mapping issues.
    2. **Remove Unsynced Item:** Since you mentioned that you've removed the product from Shopify but still see it in the BC order, try to delete the line item manually in the BC order. If it's not allowing you to do that, you may need to refresh the order or sync it again.
    3. **Sync Orders Again:** After making changes in Shopify, you may need to re-sync the order to ensure that Business Central reflects the latest updates. Ensure that the sync process completes without errors.
    4. **Review Error Logs:** Check the error logs in both Shopify and Business Central for any specific error messages that could give you more insight into what is causing the mapping issue.
    5. **Update Connector Settings:** If you are using a connector to sync between Shopify and BC, make sure that it's updated to the latest version. Sometimes, issues arise from outdated connectors.
     
  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,065 Super User 2024 Season 1 on at
    SMTP connection error while sending an email from BC OnPrem Version 25, 24
    Anyone who faced this problem?
  • Nitin Verma Profile Picture
    Nitin Verma 21,065 Super User 2024 Season 1 on at
    SMTP connection error while sending an email from BC OnPrem Version 25, 24
    hi Saif,
     
    I have already followed the steps you suggested, but it did not work, same error I am facing. Do you have any other alternate solution?
     
    Appreciate for your answer.
     
  • Suggested answer
    Saif Ali Sabri Profile Picture
    Saif Ali Sabri 231 on at
    SMTP connection error while sending an email from BC OnPrem Version 25, 24

    My response was crafted with AI assistance, tailored to provide detailed and actionable guidance for your query.
     

    The error you're encountering while configuring the SMTP connection in Microsoft Dynamics 365 Business Central (BC) On-Premises versions 24 and 25 is primarily related to SSL/TLS and the inability to validate the server's SSL certificate. 


    Troubleshooting Steps

    1. Verify the Certificate and Revocation Settings

    • The error suggests the certificate validation is failing due to the revocation check. This can happen if:
      • The certificate revocation list (CRL) cannot be accessed (e.g., due to network restrictions).
      • The CRL distribution point (CDP) in the certificate is unavailable or misconfigured.
      • The SSL certificate is self-signed or issued by an untrusted Certificate Authority (CA).

    Actions:

    • Open the SMTP server's certificate and verify:
      • The certificate is issued by a trusted CA.
      • The CRL Distribution Point (CDP) URL is accessible from the BC On-Prem server.
    • Check if the certificate has expired or been revoked.

    Optional Workaround: Temporarily disable the revocation check to confirm if it's the root cause:

    • Open the BCService.exe.config file (found in the BC server installation directory).

    • Add the following entry under <configuration>:

      xml 
      <runtime>
      <AppContextSwitchOverrides value="Switch.System.Net.DontEnableSchUseStrongCrypto=true;Switch.System.Net.DontCheckCertificateRevocation=true" />
      </runtime>
    • Restart the BC service and test again.

    Note: This is a temporary diagnostic step and not recommended for production environments.


    2. Ensure the BC Server Trusts the SMTP Certificate

    • BC On-Prem relies on the Windows Certificate Store to validate SSL certificates. If the SMTP server's certificate or its CA is not trusted by the server, the connection will fail.

    Actions:

    • Export the SMTP server’s root and intermediate certificates.
    • Install them in the Trusted Root Certification Authorities or Intermediate Certification Authorities store on the server where BC is installed:
      1. Run mmc.exe and add the Certificates snap-in for the local computer.
      2. Import the certificates into the relevant store.
    • Restart the BC service after importing the certificates.

    3. Configure Email Account in BC Properly

    • Double-check your SMTP settings in BC:
      • SMTP Server: Ensure it’s correct (e.g., smtp.office365.com for Microsoft 365).
      • Port: Use the correct port (e.g., 587 for TLS or 465 for SSL).
      • Authentication: Ensure credentials (username and password) are correct.
      • Use StartTLS: Enabled if required (commonly for Office 365 or other modern SMTP servers).

    Test the connection:

    • Navigate to Business Central > Email Accounts > Select your account > Click Test Email Setup.
    • If the error persists, check the Event Viewer logs on the server for more detailed error messages.

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Complete!

🔔 Be sure to subscribe to the new forums you are interested in to stay up to date! 🔔

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 229,658 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans