SmtpClient.SendAsync Method (MailMessage, Object) doesn't function in a asynchronous way

109 views Asked by At

In MSDN it is explained that this method does not block the calling thread and allows the caller to pass an object to the method that is invoked when the operation completes.

But when I used it in my asp.net project it still blocked the caller thread.

I have seen the question ever raised on stackoverflow and also on supportmicrosoft but it seems that it is still up in the air.

Code: ...

client.SendCompleted += new SendCompletedEventHandler(client_SendCompleted);
client.SendAsync(message, "0");
Response.Write("test");

Response.Write("test") can excute only after when client_SendCompleted has finished.

0

There are 0 answers