相关疑难解决方法(0)

MVCMailer SendAsync()因Amazon SES失败

如果我使用带有MVCMailer的Send(),我的SES工作正常,但SendAsync()显示下面的错误消息,是否有人知道解决此问题?谢谢!

System.Net.Mail.SmtpException: Failure sending mail. ---> System.InvalidOperationException: An asynchronous operation cannot be started at this time. Asynchronous operations may only be started within an asynchronous handler or module or during certain events in the Page lifecycle. If this exception occurred while executing a Page, ensure that the Page is marked <%@ Page Async="true" %>.
   at System.Web.AspNetSynchronizationContext.OperationStarted()
   at System.ComponentModel.AsyncOperation.CreateOperation(Object userSuppliedState, SynchronizationContext syncContext)
   at System.Net.Mail.SmtpClient.SendAsync(MailMessage message, Object userToken)
   --- End of inner exception stack trace ---
   at System.Net.Mail.SmtpClient.SendAsync(MailMessage message, Object userToken)
   at …
Run Code Online (Sandbox Code Playgroud)

c# asp.net-mvc mvcmailer amazon-ses

3
推荐指数
1
解决办法
1725
查看次数

标签 统计

amazon-ses ×1

asp.net-mvc ×1

c# ×1

mvcmailer ×1