Skip to main content

Notifications

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

  • Suggested answer
    Sjoe Profile Picture
    Sjoe 135 on at
    RE: sending e-mail from AX

    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

  • Sjoe Profile Picture
    Sjoe 135 on at
    RE: sending e-mail from AX

    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
    SouravDam Profile Picture
    SouravDam 11,723 on at
  • Sjoe Profile Picture
    Sjoe 135 on at
    RE: sending e-mail from AX

    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?

  • Martin Dráb Profile Picture
    Martin Dráb 230,868 Most Valuable Professional on at
    RE: sending e-mail from AX

    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?

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

Announcing Our 2025 Season 1 Super Users!

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

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,031 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,868 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans