如何使用C#读取收到的邮件 [英] How do I read incoming mail using C#

查看:486
本文介绍了如何使用C#读取收到的邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个解决方案,让我读取传入的电子邮件。目前我可以想到的三种方法是:

I am looking for a solution to allow me to read incoming emails. The three methods I can think of to do this at the moment are:


  1. 创建电子邮件服务器解析电子邮件

  2. 挂入现有的交换服务器

  3. 挂接已经设置了电子邮件帐户的Outlook

最好的方法是什么?如何实现它?

What is the best way to do this? And how does one go about implementing it?

谢谢

推荐答案

如果您已经将Exchange服务器作为邮箱主机进行处理,我建议通过IMAP(首选)或POP访问来利用该服务器。最近我开发了一个解决方案,通过 AfterLogic的MailBee.NET IMAP组件访问指定的邮箱我觉得值得推荐。他们有一个标准的试用版和合理的定价。另外,如果你去这条路由,POP或者IMAP自动化是足够灵活,可以使用几乎任何邮箱服务器平台;它不必局限于Exchange环境。

If you are already dealing with an Exchange server as the mailbox host I would suggest leveraging that via IMAP (preferred) or POP access. Recently I developed a solution that accesses a specified mailbox via AfterLogic's MailBee.NET IMAP component which I think is worth the recommendation. They have a standard trial version and reasonable pricing. Also if you go this route either POP or IMAP automation is flexible enough to work with almost any mailbox server platform; It doesn't have to be limited to Exchange environments.

还有免费的.NET IMAP组件,也可以做这个工作。在我有限的研究中,我发现免费的替代方案不完全满足我的所有要求,或者不那么容易学习,但是你的情况可能会有所不同。为了完整起见,这里列出了我在考虑在MailBee上花钱之前考虑的替代/免费IMAP库:

There are also free .NET IMAP components out there that may do the job as well. In my limited research I found that the free alternatives didn't quite meet all of my requirements or were not as easy to learn but your situation may differ. For completeness, here is a list of alternative / free IMAP libraries I considered before deciding to spend the money on MailBee:

  • ImapX - http://hellowebapps.com/products/imapx/
  • LumiSoft.Net Imap Client - http://www.lumisoft.ee/lswww/download/downloads/Net/
  • InterIMAP - http://interimap.codeplex.com/

解决你的问题的第二部分...实现在我最近的项目中,涉及到编写一个引用MailBee.NET IMAP库的非常简单的控制台应用程序。控制台应用程序具有标准配置文件,并接受命令行参数作为参数。我们根据我们的流程需求定义Windows计划任务来运行控制台应用程序。我相信你可以采取其他任何方式,但这是我们需要的最简单的方法。

To address the 2nd part of your question... The implementation in my recent project involved writing a very simple console application that references the MailBee.NET IMAP library. The console application has a standard config file and accepts command line arguments as parameters. We define Windows scheduled tasks to run the console application according to our process needs. I am sure you could do this any number of other ways but this was the simplest approach for our needs.

这篇关于如何使用C#读取收到的邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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