Software development stuff.

2007-06-04

File locked after sent via email attatchment

When sending attatchemnts with System.Net.Mail remember to Dispose.
If you don't invoke Dispose on the attatchment the file remains locked until Garbage Collector takes action.
I preffer to dispose the MailMessage:

Using objMM As New MailMessage
...
...
End Using

Help from here

Etiquetas: