Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Answered

SMTP Mail and HttpClient did not receive a response in local container sandbox

Posted on by Microsoft Employee

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

  • Community Member Profile Picture
    Community Member Microsoft Employee 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

  • Verified answer
    srttel Profile Picture
    srttel 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

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,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans