Skip to main content

Notifications

Announcements

No record found.

Business Central forum
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

Categories:
  • 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

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 16th

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

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,353 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,251 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans