使用C#,ASP.NET从Exchange读取电子邮件 [英] Reading Emails from Exchange using C#, ASP.NET

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

问题描述

我想从我的ASP.NET 3.5 Web应用程序中读取Exchange服务器的电子邮件。

我可以通过传递Exchange服务器名称来读取特定用户的邮箱中的电子邮件吗凭据?

您能否建议一些关于从ASP.NET中的Exchange服务器读取电子邮件的文章或代码示例?

感谢Ashok

Hi ,
    I want to read emails from Exchange server from my ASP.NET 3.5 web application.

Can i read emails from Mailbox of a particular user by passing Exchange server name and Credentials?

Can you suggest some articles or code samples about reading emails from Exchange server in ASP.NET?

Thanks
Ashok

推荐答案

假设您的目标是Exchange 2007(如果不是,则可能需要考虑使用 WebDAV ,但我无法帮助你):

通过EWS托管API ,您可以通过执行操作轻松阅读其他用户的邮箱以下内容:


Assuming you are targeting Exchange 2007 (if you are not, you may want to consider using WebDAV, but I can't help you much with it):

Using the Exchange Web Services via the EWS Managed API, you can read other users' mailboxes very easily, by doing the following:

ExchangeService service = new ExchangeService();
service.Credentials = new WebCredentials("username", "pwd");
service.AutodiscoverUrl("usertoaccess@contoso.com");

FindItemsResults<Item> findResults = service.FindItems(new FolderId(WellKnownFolderName.Inbox, "usertoaccess@contoso.com"), new ItemView(10));

foreach (Item item in findResults)
{
    // Do something with the item
}

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

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