views:

55

answers:

1

Hi

I am not able to send asynchronous mail in asp.net using c# .Though my code is correct as If I try to send mail 10 times then only of 1 time it is successful,rest of 9 times there is no error message but mail is also not sent at its destination.I am sending data in mail attachment. I want to send a file upto 5MB in size .

Any type of help will be appreciated.

+1  A: 

Chances are that all your threads are trying to read the same file at the same time, which is why 9 of them fail and only 1 succeeds (the 1 that picked it up first and locked it).

Make sure you open the file as read only for attachments, or add threading primitives that let the other threads wait for the file to be free.

Oded