如何在电子邮件到达时自动处理它们?

发布于 2024-09-25 20:32:34 字数 724 浏览 3 评论 0原文

我当前的情况是:

  1. 我的应用程序为每个用户生成一个 表单的有效系统电子邮件地址 可以这么说:[电子邮件受保护]
  2. 当用户遇到问题时可以发送一个 从任何地址发送电子邮件至该地址 预定义的系统电子邮件地址
  3. 应用程序应该接收用户发送的电子邮件并处理它们(检查垃圾邮件,插入数据库)

在这种情况下,我想到的第一个可能的解决方案是在 15 分钟内汇集电子邮件地址,在外部桌面应用程序(或类似应用程序)中处理它们(垃圾邮件或非垃圾邮件)并将它们插入数据库中。

因为我想在 .net、C#、SQL Server 2008 中执行此操作,并且它应该在 Web 服务器上运行,以下解决方案是否可以使用 WCF?

  • 我创建了一个 WCF Web 服务,当电子邮件地址收到电子邮件时,它会捕获该电子邮件并启动处理过程。

我从一开始就看到 WCF 的一个问题是我不认为它可以自动反应,到目前为止我使用 WCF 的唯一方法只是直接调用它并接收结果。所以我认为应该在电子邮件服务器和 wcf 服务之间放置另一层,并且该层应该在收到某些内容时“做出反应”。

主要思想是在电子邮件到达时对其进行处理,而不是定期从收件箱中取出。

有什么指示吗?谢谢

i have the current scenario:

  1. my app generates for each user an
    valid system email address of form
    lets say: [email protected]
  2. when an user has a problem/question he can send an
    email from any address to that
    predefined system email address
  3. the app should receive the emails sent by the user and process them(check for spam, insert in db)

in this scenario a possible first solution that i had in mind was to pool the emails addresses on a 15 minutes period, process them(spam or not spam) in an external desktop app(or similar) and insert them in a database.

because i want to do this in .net, C#, SQL server 2008, and it should run on a webserver is the below solution possible using WCF?

  • i create a WCF webservice that when an email is received by an email address it captures it and starts the processing procedure.

One problem i see with WCF from the start is that i don't think that it can auto react, the only way i used wcf until now was only for calling it directly and receiving a result. So i think another layer should be put between the email server and the wcf service and that layer should "react" when something is received.

the main idea is to process the emails as they arrive not to be pulled out of the inbox periodically.

any pointers? thank you

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

夏末的微笑 2024-10-02 20:32:34

你是对的。 Web 服务无法为您捕获任何内容。您将必须调用(使用 .ashx/或等)网络服务。这就是 Web 服务的用途。

应用程序应接收用户发送的电子邮件并对其进行处理

听起来您正在寻求开发一个电子邮件客户端;如果是这样,那么如何:

  • 创建一个电子邮件客户端应用程序(例如 此处)
  • 创建一个Windows服务,帮助处理邮件。

假设您已经定制了客户端程序,Windows 服务将与客户端一起工作,查找新消息,并相应地处理它们。

有关电子邮件客户端示例,请查看:

You are right. A web service cannot capture anything for you. You will have to call(using an .ashx/or etc) the web service. That is what the web services are for, to be called.

the app should receive the emails sent by the user and process them

It sounds like you are looking to develop an email client; if so, then how about:

  • Create an email client app (for instance here)
  • Create a windows service, to help process the mails.

Assuming that you've tailored the client program, the windows service would work-with the client, look for new messages, and processes them accordingly.

For email client examples, checkout:

送舟行 2024-10-02 20:32:34

如果连接到 Exchange 2007 SP1 或更高版本的 Exchange Web 服务看起来是最佳方法:

阅读C# 中的 MS Exchange 电子邮件

If connecting to Exchange 2007 SP1 or later Exchange Web Services looks like the best approach:

Read MS Exchange email in C#

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文