smsohan / MvcMailer

A Mailer for ASP.Net MVC that forms the Email Body using MVC Views (Razor etc.) following Ruby on Rails ActionMailer style
MIT License
582 stars 178 forks source link

Delete attachment file after send #92

Open krissaspdev opened 11 years ago

krissaspdev commented 11 years ago

I'm trying to delete a file automatically after it's being send. Error: "The process cannot access the file. (~\"Path") because it is being used by another process". The same problem using SendAsync method (using SendCompleted callback). What is the best way to delete attachment files at the end o the process ?

smsohan commented 11 years ago

You may have to dispose the mail message object and then delete it.


Sent from my iPhone Sohan SM

On 2013-03-29, at 5:21 AM, krissaspdev notifications@github.com wrote:

I'm trying to delete a file automatically after it's being send. Error: "The process cannot access the file. (~\"Path") because it is being used by another process". The same problem using SendAsync method (using SendCompleted callback). What is the best way to delete attachment files at the end o the process ?

— Reply to this email directly or view it on GitHubhttps://github.com/smsohan/MvcMailer/issues/92 .

smsohan commented 11 years ago

http://stackoverflow.com/questions/8477769/why-do-i-need-to-dispose-a-system-net-mail-mailmessage-instance


Sent from my iPhone Sohan SM

On 2013-03-29, at 5:21 AM, krissaspdev notifications@github.com wrote:

I'm trying to delete a file automatically after it's being send. Error: "The process cannot access the file. (~\"Path") because it is being used by another process". The same problem using SendAsync method (using SendCompleted callback). What is the best way to delete attachment files at the end o the process ?

— Reply to this email directly or view it on GitHubhttps://github.com/smsohan/MvcMailer/issues/92 .