The process cannot access the file because it is being used by another process

The problem was the MailMessage in .NET was holding on to the file attachments. I had to do a dispose on the attachment and then it worked.

Leave a Comment