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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Supply chain | Supply Chain Management, Commerce
Suggested Answer

How to cleanup the Batch email sending status in d365FO

(0) ShareShare
ReportReport
Posted on by 10

Purpose: The Batch email sending status cleanup process is used to remove old email sending status records that are stored in the SYSOUTGOINGEMAILTABLE table. These records are created when emails are sent through batch jobs in Dynamics 365 Finance & Operations.

I have the same question (0)
  • Suggested answer
    Syed Haris Shah Profile Picture
    1,815 Super User 2026 Season 2 on at

    Hi @CU17070630-1 ,

    If your question is to understand the purpose, then yes, you're correct. The Batch email sending status cleanup is intended to periodically remove obsolete email sending status records from the SYSOUTGOINGEMAILTABLE, preventing unnecessary database growth and helping maintain system performance. These records are mainly used for monitoring and troubleshooting email batch processing, so they can be safely cleaned up after the required retention period.
    you can access cleanup batch job: System administration > Periodic tasks > Batch email sending status cleanup

    Regards,
    Syed Haris Shah

  • CU17070630-1 Profile Picture
    10 on at

    HI @Syed Haris Shah 

    Thank you for responded.  I saw the provided navigation in the D365FO system but haven't find that cleanupjob in system admin module. May I know did we enable any feature to visible the batch email sending status cleanup?. 

    FYI

     

    2. Do you know about hte Batchhistory and Batchjobhistory differences and how to cleanup the batchhistory in the system? While I seen that batchhistory is the individual/detailed tasks that records each batchjobhistory.

     

    Thank you in advance.

  • Suggested answer
    Paolo Cecchelli Profile Picture
    687 Super User 2026 Season 2 on at

    Hi,

     

    as far as I know per standard there is no cleanup job doing that, this is the list of the cleanup jobs available:  https://learn.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/sysadmin/cleanuproutines . As per standard the only option is the mass selection and deletion from the form.

     

    You might referring to third-party solutions like Docentric that actually provides a cleanup batch as part of their realease (https://ax.docentric.com/batch-email-sending-status-improvements/ ).

     

    Hope it helps,

    Paolo

  • Suggested answer
    Syed Haris Shah Profile Picture
    1,815 Super User 2026 Season 2 on at

    Hi @CU17070630-1 ,

    My apologies, I mistakenly shared details about a custom batch job from my environment.

    In the standard D365 F&SCM solution, you can configure the email retention period by specifying the number of days. The system will retain email history for the configured duration, and older email history will then be eligible for cleanup.

     

    Regards,

    Syed Haris Shah

  • Suggested answer
    Subra Profile Picture
    1,938 Super User 2026 Season 2 on at

     

    Hi @CU17070630-1 

    I hope we don't have any standard batch jobs to cleanup in batch email history status.

    Additionally, you can use the below option to cleanup the batch job email sent and failed status using below options.

     


    If you enter Zero or leave it blank, the system applies the default 30-day retention period.

    Thanks,
    Subra

    If this helped, please mark it as "Verified" for others facing the same issue





     

  • Suggested answer
    SoumitraforD365 Profile Picture
    248 Super User 2026 Season 2 on at

    Hi,
    If you are referring to the “ Batch email sending status”, in which the records get accumulated over time and affect performance.
    There are few ways clean them: 
    Option 1

    • Go to System Administration > Periodic tasks > Batch job history cleanup
    • Configure the retention period (for example, delete records older than 30 or 90 days).
    • Schedule it as a recurring batch job.
    If the email sending status is stored as a batch history, this will be the safest option.
     
    Option 2:
    If you are using the email framework, SMTP or Exchange, Navigate to 
    System admin > Periodic tasks
    • Email history cleanup
    • Email distributor cleanup
    • Email sending status cleanup
    Thanks
  • Suggested answer
    Navneeth Nagrajan Profile Picture
    2,659 Super User 2026 Season 2 on at

    Hi @CU17070630-1,

    Regarding batch email sending status in D365 FO through the feature being enabled “Email distributor batch job email expiration”, the feature references the Email parameters → Email history → Number of days to retain email history and marks them as expired. 
    The other option is to add this field called Email status to the screen Batch email sending status (System Administration → Periodic Tasks → Email processing → Batch email sending status) and then filter the status you are looking to delete and using standard delete to remove the emails.

    However, as a recurring automated job if you are looking to cleanup the table SysOutgoingEmail as a whole through a X++ script run as a recurrence through a batch or create a recurring data project to delete records from SysOutgoingEmailTable.

    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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
Laurens vd Tang Profile Picture

Laurens vd Tang 93 Super User 2026 Season 2

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 81 Super User 2026 Season 2

#3
Sagar Suman Profile Picture

Sagar Suman 48 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans