在Windows服务asp.net中使用EWS发送邮件时操作超时错误c# [英] Operation timed out error while sending mails using EWS in Windows service asp.net c#

查看:120
本文介绍了在Windows服务asp.net中使用EWS发送邮件时操作超时错误c#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我写了一个Windows服务,它不断从表TrnEmails中获取详细信息并将邮件发送到相应的每个To Email ID,这是一个列那个表。

我用EWS发送邮件(asp.net c#)。

这个服务突然开始抛出异常。 **在日志文件中,我还发现异常在2分钟后不断重复。**

异常详情:

异常消息:请求失败。操作已超时

内部异常消息:操作已超时

异常来源:MailHandler.EWS

异常跟踪:在MailHandler。 Interface.IMailItem.Send()

at NotificationService.NotificationService.OnElapsedTime(Object source,ElapsedEventArgs e)

Exception Target:Void MailHandler.Interface.IMailItem.Send()< br $> b $ b



由于这几封邮件没有到达最终用户。我浏览了这个链接http://stackoverflow.com/questions/14468822/exchange-web-services-streaming-subscription-timeout-when-opening-connection但没有用。



请帮我解决这个问题。

提前致谢。

Hi All,

I have written a windows service which keeps fetching details from a table TrnEmails and send mail to respective each To Email ID which is a column in that table.
I am using EWS to send the mail(asp.net c#).
This service has suddenly started throwing below exception. **In the log file,I also observed that the exception keeps repeating after 2 minutes.**
Exception details:
Exception message : Request failed. The operation has timed out
Inner Exception message : The operation has timed out
Exception Source : MailHandler.EWS
Exception Trace : at MailHandler.Interface.IMailItem.Send()
at NotificationService.NotificationService.OnElapsedTime(Object source, ElapsedEventArgs e)
Exception Target : Void MailHandler.Interface.IMailItem.Send()


As a result of this few mails are not reaching the end user. I went through this link http://stackoverflow.com/questions/14468822/exchange-web-services-streaming-subscription-timeout-when-opening-connection but no use.

Please help me out to resolve this issue.
Thanks in advance.

推荐答案





虽然我没有太多使用过EWS,但我找到了一些要点。



首先,您使用的是什么版本的Exchange?



其次,即使查询没有超时,也可以使用分页。检查一下:

http://blogs.msdn.com/b/exchangedev/archive/2010/03/12/throttling-policies-and-the-ewsfindcountlimit.aspx [ ^ ]



如果你实现分页和小提琴的最佳页面大小将低于1000并且还减少了你检索到你实际使用它们的属性应该有助于解决问题并提高性能您的应用程序。



EWS托管API的默认超时为90秒,并在ExchangeService对象上设置。您可以将此值设置为更高的值,例如将其设置为5分钟



如果服务器忙碌一段时间或任何其他环境,则可能发生这种情况。我建议你检查EWS.Log在Exchange服务器上查看当时发生的事情。





问候,

Praneet
Hi,

Though I havent much used EWS, I found some points.

Firstly, what version of Exchange are you using ?

Secondly, you could use paging even if you query didn't timeout. Check this:
http://blogs.msdn.com/b/exchangedev/archive/2010/03/12/throttling-policies-and-the-ewsfindcountlimit.aspx[^]

If you implement paging and fiddle with optimal page size which will be under 1000 and also reduce the properties your retrieving down to those you actually using this should help solve the problem and increase the performance of your application.

The default timeout with the EWS Managed API is 90 seconds and is set on the ExchangeService Object. You can set this to a higher value e.g to set it to 5 minutes

If the server is busy for a time or any other environmental this can happen . I would suggest you check the EWS.Log on the Exchange server to see what happened at that time.


Regards,
Praneet


这篇关于在Windows服务asp.net中使用EWS发送邮件时操作超时错误c#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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