通过电子邮件触发 SQL Server 2005 中的存储过程
如何根据到达 Exchange 收件箱的电子邮件(启用 POP3/IMAP)触发 SQL Server 2005 中的存储过程? 如果可能的话,我宁愿不使用 Windows 服务,而是使用 SQL Server 功能。
How can I trigger a stored procedure in SQL Server 2005 based on emails arriving in an Exchange inbox (with POP3/IMAP enabled)? I'd rather not use Windows Services if possible, and use the SQL Server functionality instead.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Exchange 有事件接收器,可以将数据写入数据库。
示例: http://www.codeproject.com/KB/cs/csmanagementeventsinkshooks.aspx< /a>
以某种方式使用 SQL Server 或 Windows 服务进行操作需要轮询更改,这效率较低; 要么通过密集轮询消耗大量资源,要么在注意到新消息之前有一些延迟。 事件接收器基本上是立即调用的,并且根据接收器,您甚至可以影响消息。
Exchange has Event Sinks which could write data to the DB.
Sample: http://www.codeproject.com/KB/cs/csmanagedeventsinkshooks.aspx
Doing thins using SQL Server somehow or a Windows Service would require polling for changes, which is less efficient; either you consume much resources through intensive polling or you have some delay until you notice a new message. The event sinks are basically invoked right away, and depending on the sink you can even influence the message.