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.

Comments

Popular posts from this blog

Tutorial: Using Google Cloud Storage from C# and .NET

Late 2008 Macbook only giving 1.5 gb/s speed with 6 gb/s Intel SSD?

The ridiculous interview experience