Aug 23

As reported in multiple blogs and user forums, the SMTP component had an issue about locking the files that was attached to sent emails. This usually always caused issues, as you would clean up your temporarily generated files after having sent them with the email attachment.

According to the released hotfix KB2280492, this was occurred occurs because Microsoft .NET Framework waits for the garbage collector to release resources when .NET COM objects are retained in memory.

Curious as most i looked into the fix they released to see what was actually changed, as it uses some standard .NET components to send the emails with.

So to start with lets take a look at the methods of the old old mail component, that had the issue with the GC (garbage collection):

Next lets take a look at the new component to see the methods that has been added to handle overrides for Dispose():

Looking at the specific method you will see this code in the Dispose():

Simple, thanks Microsoft for fixing and thanks to Steffen Brandt for pointing me to this hotfix! Anyways, as you can see it is back to work now – looking at a week here in southern California with temperatures in the 100’s, ouch – going to be fun!

The above “reflection” on .NET code is done with Red Gates .NET Reflector tool. I will do a blog posting later this week, on how to use this great tool.

Here is the KB files: [dm]10[/dm]

One Response to “Attachments are not released until the Microsoft Dynamics NAV client is closed when you use the SMTP mail codeunit (400)”

  1. Luc van Vugt says:

    Welcome back again, Søren.

Leave a Reply

preload preload preload
pornpants.com pornofri.com kilporn.com