Sending emails with attachments in .NET (Caveats)
This is quite easy to do, what is not so apparent though is that if you try to delete the attachment either in code or manually even after the mail is sent, it does not let you do it.
This puzzled me for a while.
Now, I realize - you need to dispose the MailMessage - if you don't then it hangs on to the file until your program restarts.
This puzzled me for a while.
Now, I realize - you need to dispose the MailMessage - if you don't then it hangs on to the file until your program restarts.
Comments
Post a Comment