Elmah:发送异常邮件给支持团队 [英] Elmah : Sent Exception mail to support team

查看:121
本文介绍了Elmah:发送异常邮件给支持团队的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我使用Elmah获取异常信息运行时间。



I将所有设置和存储的异常信息设置到数据库中,我参考了这个教程: http:/ /www.asp.net/hosting/tutorials/logging-error-details-with-elmah-cs



但我希望通过以下方式获取异常信息电子邮件。



我只在Web.config中添加了这个部分

Hi,

I am using Elmah for getting exception information run-time.

I set all setting and stored exception info into database, I refered this tutorial: http://www.asp.net/hosting/tutorials/logging-error-details-with-elmah-cs

But I want to get exception info through E-mail.

I added only this part into Web.config

<errormail from="support@example.com">
  to="support@example.com"
  subject="Book Reviews Runtime Error"
  async="true" /></errormail>



但是当异常通过此异常时:未指定SMTP主机。



请告诉我我的工作。



提前致谢。


But when exception through this give exception: The SMTP host was not specified.

Please tell me what I do.

Thanks in advance.

推荐答案

我不知道您正在使用的库,但从错误消息判断您未指定要发送的邮件服务器(也称为SMTP主机)邮件。结论:您的应用程序需要在某个邮件服务器上拥有一个邮件帐户,并且只能通过其帐户和凭据在此服务器上发送邮件。



编辑:并且,当然,您应该在此配置中查找另一个设置,您可以在其中指定邮件服务器。只是猜测,但我会寻找类似'< SMTPHost ..... />'
I do not know the library you are using, but judging from the error message you did not specify the mail server (aka the SMTP host) from which you whish to send the mail. Bottom line: Your application will need to have a mail account on some mail server and can only send mails over this server with its account and credentials.

And, of course, you should look for another setting in this configuration where you can specify your mail server. Just guessing, but I would look for something like '<SMTPHost ..... />'


CDP1802 在正确的轨道上。



还有一些属性要设置在 errormail 元素。



这是一个例子:



CDP1802 was on the right track.

There are a few more attributes to set on the errormail element.

Here's an example:

<errorMail

    from="elmah@example.com"

    to="support@example.com"

    subject="Automated Error Report"

    async="true"

    smtpPort="25"

    smtpServer="smtp.example.com"

    userName="johndoe"

    password="secret" />





您可能不需要指定用户名/密码,具体取决于您的网络和SMTP服务器。



有关详细信息,请参阅此帮助文章:



http://code.google .com / p / elmah / wiki / DotNetSlackersArticle #configuration_error_notifications [ ^ ]


这篇关于Elmah:发送异常邮件给支持团队的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆