Mail Event locking file attachments - Solution

  • 26 October 2007
  • 0 replies
  • 0 views

Badge +1
This is probably one for SourceCode, but I noticed that the Mail Event
was keeping file attachments locked after the Process had run. I
drilled down into the code behind for the XOML and saw that the
MailMessage object wasn't being disaposed of after the SMTPClient does
the send. Check Jonathan Allen's comment in the MSDN ref for the
MailMessage class here
.



Solution:


Alter the Design Template for the mail event item, found at:

%ProgramFiles%K2 blackpearlBinDesignTemplatesCSharpWindowsWorkflowExtender1033Mail.MailEventItemEventItemAdditionalFiles@safeitemname@.xoml.cs

Add:
    this.EmailMessage.Dispose();
just after:
    _client.Send(this.EmailMessage);

Hope this helps (until it's hotfixed).


0 replies

Be the first to reply!

Reply