需要在 IIS 上为 ASP.Net 核心身份服务器配置 SMTP 设置以进行电子邮件验证

Need to configure SMTP settings on IIS for the ASP.Net Core Identity server for the EMail verification

我成功部署了身份服务器,它工作正常,还在 VPS 上配置了 SMTP 设置,但是当尝试使用 ASP.Net 核心 3.1 应用程序设置它时找不到 SMTP在使用 IIS 的功能中。 我使用无托管代码作为应用程序池。 下面是关于我的问题的图片

我将 sendgrid 用于 MTA,简而言之,使用 sendgrid 配置 SMTP。问题是在 appsettings.production.json 中添加其秘密和 API 密钥 以下是代码:

   {
  "ConnectionStrings": {
    "DefaultConnection": "Server=.;Database=DatabaseName;Trusted_Connection=True;MultipleActiveResultSets=true"       
  },
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft": "Warning",
      "Microsoft.Hosting.Lifetime": "Information"
    }
  },
  "SendGridUser": "Put User name Here",
  "SendGridKey": "Put API Key Here",
  "RequireConfirmedEmail": true
}

不需要为站点设置 SMTP,只需要为其工作的主 IIS 节点配置 SMTP。

在 .net 核心中不需要 asp.net 设置。在旧版本中需要它。我们只需要更改 appsettings.json 中的配置(SMTP)电子邮件设置以及 MTA(第三方)