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

Announcements

No record found.

News and Announcements icon
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

  • Verified answer
    srttel Profile Picture
    Microsoft Employee on at

    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

    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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 633 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 419 Super User 2026 Season 2

#3
Teagen Boll Profile Picture

Teagen Boll 236 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans