I create attachments like this:
var msg = new MailMessage();
Attachment attachment = new Attachment(path, displayName);
In general it is working fine.
But if I send a file that is currently opened in Microsoft Word or Excel, I get this exception:
System.IO.IOException: The process cannot access the file 'C:test.docx' because it is being used by another process.
However, adding an opened file to another mail client (like Microsoft Outlook) works well.