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

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Emails dispatching batch job not sending mails

(1) ShareShare
ReportReport
Posted on by 3,801

Hi All,

I have created a batch job for dispatching mails every day at 8:00 PM.

Jobs run successfully but not dispatching emails. 

Anybody know the issue?

We are using AX 2012 R3 CU11.

Note: Emails are dispatching if we execute them manually. Issue is only in dispatching through Batch jobs.

Regards,

Hassan

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Jonathan  Halland Profile Picture
    11,310 on at
    RE: Emails dispatching batch job not sending mails

    Hassan,

    Have you checked your Email Queue? If the emails are in a "failed" state then there is likely something wrong with your SMTP server specified in AX. Check the following

    1. Have you specified an SMTP server and is it a valid server name

    2. Does the SMTP server allow for SMTP relay from your AOS batch server.

    3. Does your SMTP server have any blocking rules? E.G. Only allows emails to accounts on your domain

    4. Does your SMTP allow for "anonymous" sending. I.E. Can you login without username and password.

  • gyan chand kabra Profile Picture
    380 on at
    RE: Emails dispatching batch job not sending mails

    Hasan,

    In addition you can check the email templates as well and the batch groups assigned to these email templates. I had a similar issue and issue has been resolved by modifying email templates.

  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at
    RE: Emails dispatching batch job not sending mails

    If you provided multiple e-mail accounts either with comma or semicolon, Standard AX will fail to process those e-mails. Ievgen has published a fix on his blog, you can search for it.

    Also your sender accounts' e-mail address should be populated in the User Options screen., otherwise most mail servers will not allow you to send it out without a from address populated.

  • Hassan_rulz Profile Picture
    3,801 on at
    RE: Emails dispatching batch job not sending mails

    Hi all,

    Emails get dispatch if we run email dispatching jobs manually. So, I think there is no issue in email settings.

    Regards,

    Hassan

  • Jonathan  Halland Profile Picture
    11,310 on at
    RE: Emails dispatching batch job not sending mails

    Hi Hassan.

    Do the emails remain in a "waiting" or a "failed" state in the batch job?

  • Hassan_rulz Profile Picture
    3,801 on at
    RE: Emails dispatching batch job not sending mails

    Hi Jonathan,

    If I execute batch job then it ended but no emails dispatch.

    I have to manually run jobs for dispatching emails.

    Regards,

    Hassan

  • Jonathan  Halland Profile Picture
    11,310 on at
    RE: Emails dispatching batch job not sending mails

    Hi Hassan.

    Can you explain a bit more regarding the emails that are not dispatching?

    - What type of emails are they? (Alerts, Workflow, other...)

    - Can you confirm that the mails are in your Email Sending Queue?

    - What status are the emails in the sending queue after the batch job has run.

    Screenshots will assist.

  • Suggested answer
    Hassan_rulz Profile Picture
    3,801 on at
    RE: Emails dispatching batch job not sending mails

    Hi Jonathan,

    Sorry for late reply.

    -Email types are other.

    -yes emails are in email sending queue.

    -Same as before

    Regards,

    Hassan

  • Martin Dráb Profile Picture
    236,513 Most Valuable Professional on at
    RE: Emails dispatching batch job not sending mails

    Try debugging your code. You said it fails only in batch, so you can debug the batch, nevertheless I would first check if it works if I run it in CIL on server in synchronous manner, to avoid dealing with batch.

    People often compare code running in a job and in batch, not realizing it that it uses runs as a different user, on a different machine and using a completely different runtime environment (X++ runtime vs. CLR), therefore these are very different things. Therefore you should test these things, such as trying if it still works if you execute code on server, if you run it in CIL etc. But if you don't see any problem, debugging the batch is possible too.

    You may find that the code executes correctly and you don't have to spend any more time with it, because the problem is somewhere else. But more likely you'll spot wrong behavior.

  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at
    RE: Emails dispatching batch job not sending mails

    Try setting a valid e-mail address in the user options of your e-mail dispatching batch job/service account, and also allow that user within your AD/Office365 configuration/Exchange server settings to distribute e-mails.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Tocauer Profile Picture

Martin Tocauer 4

#2
Community Member Profile Picture

Community Member 2

#2
Nayyar Siddiqi Profile Picture

Nayyar Siddiqi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans