我使用以下代码尝试异步发送电子邮件,但没有发送电子邮件,我不确定是什么做错了.我还在web.config中为电子邮件协议添加了第二段代码.
SendEmailAsync代码
await UserManager.SendEmailAsync(username.Id, "MTSS-B: Forgot Password", "Here is your new password. Please go back to the MTSS-B web tool and sign in. You will be prompted to create your own password.<br/><br/>" + tmpPass + "<br/><br/>MTSS-B Administrator");
Run Code Online (Sandbox Code Playgroud)
Web.config代码
<system.net>
<mailSettings>
<smtp>
<network host="smtp1.airws.org" userName="" password="" />
</smtp>
</mailSettings>
</system.net>
Run Code Online (Sandbox Code Playgroud)
********更新
我测试了是否可以使用常规方法发送电子邮件,并且可以使用以下代码发送电子邮件.
MailMessage m = new MailMessage(new MailAddress(ConfigurationManager.AppSettings["SupportEmailAddr"]), new MailAddress(model.Email));
m.Subject = "MTSS-B: Forgot Password";
m.Body = string.Format("Here is your new password. Please go back to the MTSS-B web tool and …Run Code Online (Sandbox Code Playgroud) 标题几乎都说明了.有没有办法在不使用发送网格的情况下将电子邮件确认添加到我的应用程序?我的Azure帐户不允许我使用它,说它在我的区域中不可用,我似乎无法找到另一种解决方案.