Programmatically Checking for Outlook E-mails

不羁的心 提交于 2019-12-12 03:13:04

问题


I'm setting up an automated response with a third party. The third party can only respond via e-mail, so I need a way to determine when I get a new e-mail. My plan is to create a windows task that will run a C# program that checks to see if a new e-mail is from this third party.

My company uses outlook, which runs off of the Microsoft Exchange database. I did some research, and I saw that some people use the Microsoft MAPI namespace. Is this the way to go about it? Is there some way that I can use System.Net.Mail to check for new mail from a particular address?

Thanks, Aaron


回答1:


Depending on your requirements you could use Outlook Interop / MAPI which is simply using Outlook from code - in this case look at: Microsoft.Office.Interop.Outlook assembly. This has the benefit of an event firing on new items popping up in your mailbox.

On the other hand if your server supports POP3, you can simply get random POP3 libray and periodically query the server.



来源:https://stackoverflow.com/questions/1106212/programmatically-checking-for-outlook-e-mails

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!