You have to wait for SMTP to finish sending the email and its attachment.
After that you should Dispose the MailMessage object and then the attachment is unlocked.
So:
SmtpClient oSmtp = new SmtpClient();
MailMessage oMail = new MailMessage();
oSmtp.Send(oMail);
oMail.Dispose();
This worked for me just fine.