C# / Exchange 电子邮件客户端

发布于 2024-08-16 05:49:35 字数 299 浏览 1 评论 0原文

我需要创建一个非常简单的 C# Windows 服务来侦听和处理具有特殊主题行的电子邮件。我已经有了可以很好地处理这些电子邮件的代码。为了便于开发,我只是将代码打包在我自己机器上的“Outlook Addin”中,并在我自己的电子邮件帐户下运行。效果很好。

现在它可以工作了,我需要将其移至服务器。为此,我在 Exchange Server 上设置了一个特殊的电子邮件帐户。我真的不希望 Outlook 在服务器上运行。是否有其他方法可以在不使用 Outlook 客户端的情况下登录此电子邮件帐户并侦听来自我的 Windows 服务的电子邮件?

谢谢!

I need to create a very simple c# Windows Service to listen for, and process email wth special subject lines. I already have the code that process these emails working well. For ease of development, I just packaged the code in an "Outlook Addin" on my own machine, running under my own email account. Works great.

Now that it's working, I need to move this to the server. I have a special email account setup on the Exchange Server for this purpose. I really don't want Outlook running on the server. Is there some other way to login to this email account and listen for email from my Windows Service without using the Outlook client?

Thanks!

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

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

发布评论

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

评论(2

笑脸一如从前 2024-08-23 05:49:35

听起来您的代码与 Outlook 紧密相关,因此您可能必须更改服务器的方法。去年我遇到了完全相同的问题,并考虑了以下选项:

您还需要问自己 - 您真的这样做吗? 需要您的程序来检查邮件服务器吗?我无法使用上述任何选项,因此最终让其中一位邮件管理员设置了一条交换规​​则,将电子邮件/附件放入服务器上的一个特殊文件夹中。然后我就可以在闲暇时处理这些文件。与通过代码直接询问邮件服务器相比,工作得非常好并且更容易维护。

It sounds like your code is closely tied to Outlook, so you may have to change your approach for the server. I faced exactly the same problem last year and considered the following options :

You also need to ask yourself - do you actually need your program to check the mail server? I couldnt use any of the above options so ended up having one of the mail admins set up an exchange rule that dropped the emails/attachments into a special folder on the server. I could then process the files at my leisure. Worked extremely well and much easier to maintain than directly interrogating the mail server through code.

诗化ㄋ丶相逢 2024-08-23 05:49:35

如果您的 Exchange 管理员已启用它,您可以使用 IMAP 或 POP3 连接到服务器。

您也可以使用 MAPI 进行连接。

您可以找到许多库(免费的和其他的)来完成这三个任务。

我对 MailBee IMAP 有很好的经验,但如果您只需要执行一些简单的功能,肯定有免费的替代方案。

If your exchange admin has enabled it you can use IMAP or POP3 to connect to the server.

You can also use MAPI to connect as well.

You can find a number of libraries (free and otherwise) for doing all three.

I have had good experience with MailBee IMAP but there are definitely free alternatives if you only need to do some simple functionality.

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