【问题标题】:Azure Website Elmah SMTP Mail not working when deployedAzure 网站 Elmah SMTP 邮件在部署时不起作用
【发布时间】:2013-07-19 21:09:38
【问题描述】:

我一直在尝试在我的 Azure 网站中设置 Elmah 电子邮件,但没有成功。我可以使用 GMail 或 Hotmail SMTP 设置在我的本地主机上运行它。但是,当部署到我的 azure 网站时,它不起作用。我的异常在本地和生产中都正确记录。只有电子邮件失败(或者网络甚至尝试发送,我一直无法追踪错误或异常)

这可以在 Azure 网站中设置吗?

我的 elmah 电子邮件设置:

<errorMail
      from="somehotmailaccount@hotmail.com"
      to="somehotmailaccount@hotmail.com"
      subject="Error"
      async="true"
      useSsl="true"
      enablessl="true"
      port="0" />

我的 Smtp 邮件设置:

 <smtp from="somehotmailaccount@hotmail.com">
        <network enableSsl="true" host="smtp.live.com" port="25" userName="somehotmailaccount@hotmail.com" password="somepassword" />
</smtp>

非常感谢!

【问题讨论】:

  • 不确定我是否正确。 Azure 不提供 SMTP,您需要像 SendGrid 这样的邮件服务来发送电子邮件。

标签: azure smtp elmah azure-web-app-service


【解决方案1】:

您需要 ErrorMail httpModule。

在部分内添加这一行

<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" />

我建议您观看视频。 第 56 集 - Windows Azure 中的日志记录、跟踪和 ELMAH / http://channel9.msdn.com/Shows/Cloud+Cover/Episode-56-Logging-Tracing-and-ELMAH-in-Windows-Azure

【讨论】:

  • 我在我的模块部分注册了这个。 nuget 包为我配置了这些。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2013-10-20
  • 1970-01-01
  • 2023-03-20
  • 2011-01-25
  • 2022-08-09
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多