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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

sending e-mail from AX

(0) ShareShare
ReportReport
Posted on by 135

Hello, in my implementation AX is capable of sending e-mails with attachments (i.e invoice documents) without any problem.

For example with the AX client I can go in the invoice journal select hundreds of invoices and select "Use print management" under the "Preview/Print menu".

I did setup recently a batch job that generates invoices and use print management using the standard AX functionality in Accounts Receivable - Periodic - Sales Update - Invoice. The job completes though in the log I see that for some invoices (not all) AX is generating the following error message :

"The message could not be sent to the SMTP server. The transport error code was 0x80040217. The server response was not available
Exception has been thrown by the target of an invocation. The message could not be sent to the SMTP server. The transport error code was 0x80040217. The server response was not available"  

Of course if I go in invoice journal, select those documents and "Use print management" no errors at all

I have been digging but not able to find the cause. Checked the SMTP logs and there are no errors. Checked the event viewer of the server and there are no errors.

Is there someone who generates and sends invoice documents in a batch mode? did you ever experience such an error?

I do have an idea, that it may be cause by the fact that batch are multi-threading so in certain moment one thread is conflicting with another when invoking the SMTP server. Any idea if it is possible to force a batch job to run single-thread?

Thanks in advance for your help

Regards

I have the same question (0)
  • Martin Dráb Profile Picture
    239,381 Most Valuable Professional on at

    Does it mean that some emails were sent and some failed?

    Doesn't the SMTP server have a limit on how many messages can be sent at a certain time frame?

  • Sjoe Profile Picture
    135 on at

    Correct,  within the same batch execution the shows 3 are sent, the next fails, the next 5 are sent etc Not really with an explainable logic.

    Yes there is a limit but wouldn't that apply when executed in online too?

  • Suggested answer
    SouravDam Profile Picture
    11,730 on at
  • Sjoe Profile Picture
    135 on at

    Hello,

    I looked at each of them. I don't believe that it is something so deep in the code. Beside some articles are related to 2009 and not to 2012. As I wrote I can send hundreds of e-mails each day. I'm not even able to replicate the error in the test environment that makes it more difficult to troubleshoot. Any other idea?

    Thanks

    Regards

  • Suggested answer
    Sjoe Profile Picture
    135 on at

    Hello, I was able to find the problem and is peculiar for an Italian implementation. In Italy we have certified e-mail that can be used instead of certified mail. In AX System Administration you can specify both the e-mail parameters for sending normal e-mails and the certified e-mail parameters for sending certified e-mail. In the customer master is possible to add e-mail addresses either for normal e-mail or for certified e-mail. If a customer happens to have both an e-mail address defined as scope invoice ordinary (normal e-mail) and another with scope invoice (certified e-mail) then the batch job sending out the invoice document as attachment of an e-mail fails as it cannot invoke in the same e-mail the SMTP for normal e-mail and the one for certified.

    My fix was to change all the certified e-mail from scope "invoice" to scope "home".

    Hope this helps

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 689

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 606 Super User 2026 Season 1

#3
CP04-islander Profile Picture

CP04-islander 356

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans