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 and HttpClient did not receive a response in local container sandbox

(0) ShareShare
ReportReport
Posted on by

Hello,

I'm new in Dynamics 365 and specifically to Business Central. I got an issue when trying to make a call to external API and I already asked about that, but got no answer. here's the link: httpclient always return false in sandbox container local 

and then I tried to use the SMTP client to send an email and it didn't works, I'm using SMTP server https://mailtrap.io/. I think this has the same problem, my BC container cannot receive any response from outside.

its weird, this both SMTP for Email and HttpClient is works on my sandbox online.

here are the error messages:

pastedimage1597217316431v1.png

PowerShell Script:

#install-module navcontainerhelper -force

# set accept_eula to $true to accept the eula found here: https://go.microsoft.com/fwlink/?linkid=861843
$accept_eula = $true

$containername = 'testing-bc2'
$navdockerimage = 'mcr.microsoft.com/businesscentral/sandbox:xxxxx-au'
$appbacpacuri = ''
$tenantbacpacuri = ''
$additionalParameters = @()
if ($appbacpacuri -ne '' -and $tenantbacpacuri -ne '') {
    $additionalParameters = @("--env appbacpac=""$appbacpacuri""","--env tenantBacpac=""$tenantbacpacuri""")
}

$credential = get-credential -UserName $env:USERNAME -Message "Using Windows Authentication. Please enter your Windows credentials."
New-NavContainer -accept_eula:$accept_eula `
                 -memoryLimit 4G `
                 -containername $containername `
                 -auth NavUserPassword `
                 -Credential $credential `
                 -alwaysPull `
                 -doNotExportObjectsToText `
                 -usessl:$false `
                 -updateHosts `
                 -assignPremiumPlan `
                 -shortcuts Desktop `
                 -imageName $navdockerimage `
                 -additionalParameters $additionalParameters

Setup-NavContainerTestUsers -containerName $containername -password $credential.Password

I have the same question (0)
  • Verified answer
    srttel Profile Picture
    on at
    RE: SMTP Mail and HttpClient did not receive a response in local container sandbox

    Hi, when reading this it sounds more like an environmental issue when running BC on docker container, that there is an issue communicating with the SMTP server.

    So, you might have to open the specific port in the container.

    serverfault.com/.../sending-mail-from-inside-docker-container

  • Community Member Profile Picture
    on at
    RE: SMTP Mail and HttpClient did not receive a response in local container sandbox

    thanks for answering my question,

    but its already fixed on here : community.dynamics.com/.../httpclient-always-return-false-in-sandbox-container-local

    i will close this question. to fix this just add -dns '8.8.8.8' to my PowerShell Script

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,377

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 2,696 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,512 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans