Send mail with smtp SendAsync

后端 未结 3 615
滥情空心
滥情空心 2021-01-24 22:58

this is how when I need to send email gives me error. But the mistake that since gives me is this:

An asynchronous operation cannot be started at this tim

3条回答
  •  伪装坚强ぢ
    2021-01-24 23:45

    You can also try to define your async option inside a separate thread. I believe that you already have inserted the async tag in your page. And if everything is okay then try to put your code in below block.

     this.Page.RegisterAsyncTask(new PageAsyncTask(async ctoken => {
          var result = await SomeOperationAsync(ctoken);
          // result operations.
    }));
    

提交回复
热议问题