`
wen_pp
  • 浏览: 23726 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

从exchange server 获取out of office 信息

    博客分类:
  • .Net
阅读更多
using System;
using System.Net;
using GetOFFS.sg.com.ncs.webmail;
using Microsoft.Exchange.WebServices;
using Microsoft.Exchange.WebServices.Data;


namespace GetOFFS
{

    public class Program
    {
        public static string url = "https://exchangeserveraddress/ews/Exchange.asmx";
        static void Main(string[] args)
        {
            ExchangeServiceBinding esb = new ExchangeServiceBinding();
            esb.Credentials = new NetworkCredential("username", "password", "domain");
            esb.Url = url;
            esb.RequestServerVersionValue = new RequestServerVersion();
            esb.RequestServerVersionValue.Version = ExchangeVersionType.Exchange2010_SP1;
            GetMessageTrackingReportRequestType gmt = new GetMessageTrackingReportRequestType();
            
            GetMailTipsType gmType = new GetMailTipsType();
            gmType.MailTipsRequested = new MailTipTypes();
            gmType.MailTipsRequested = MailTipTypes.OutOfOfficeMessage;
            gmType.Recipients = new EmailAddressType[1];
            EmailAddressType rcip = new EmailAddressType();
            rcip.EmailAddress = "target@emailaddress";
            gmType.Recipients[0] = rcip;
            EmailAddressType sendAs = new EmailAddressType();
            sendAs.EmailAddress = "target@emailaddress";
            gmType.SendingAs = sendAs;

            GetMailTipsResponseMessageType gmResponse = esb.GetMailTips(gmType);
            if (gmResponse.ResponseClass == ResponseClassType.Success)
            {
                if (gmResponse.ResponseMessages[0].MailTips.OutOfOffice.ReplyBody.Message != "")
                {
                    //User Out   
                    Console.WriteLine(gmResponse.ResponseMessages[0].MailTips.OutOfOffice.ReplyBody.Message);
                }
                else
                {
                    //user In   
                }

            } 
        }
    }
}
分享到:
评论

相关推荐

    Microsoft.Office.Outlook.2003.Inside.Out

    书中的内容可能还包括了高级功能,如使用Outlook与Microsoft Exchange Server集成,实现离线工作,以及备份和恢复数据的方法。此外,书里可能还会涉及如何与其他Office应用程序(如Word、Excel)集成,以增强办公...

    计算机网络第六版答案

    An Internet Exchange Points (IXP) (typically in a standalone building with its own switches) is a meeting point where multiple ISPs can connect and/or peer together. An ISP earns its money by ...

    Java邮件开发Fundamentals of the JavaMail API

    take advantage of protocols for which Sun does not provide out-of-the-box support. You'll find support for NNTP (Network News Transport Protocol) [newsgroups], S/MIME (Secure Multipurpose Internet ...

    Microsoft SharePoint 2013 Administration Inside Out

    包括如何在SharePoint中集成其他应用程序和服务,比如Exchange Server、Office 365等。 9. 性能优化与故障排查。提供了对SharePoint 2013性能监控、诊断和优化方法的介绍,并指导如何处理日常管理中可能遇到的问题...

    Microsoft 70-630 v3.25

    7. **集成其他Microsoft产品**:掌握如何将SharePoint与Exchange、Office、Project Server等其他Microsoft产品集成,以提升协作效率。 8. **解决方案部署**:学习如何部署和管理解决方案包,包括WSP(Windows ...

    Essential SharePoint 2010

    8. **集成与API**:SharePoint 2010可以与Office套件、Exchange Server、BizTalk Server等其他微软产品无缝集成。同时,它提供了丰富的开发接口,如SOAP、REST和CSOM(Client Side Object Model),使得开发者可以...

    a project model for the FreeBSD Project.7z

    This, combined with the vast amount of dependencies in the kernel and that it is not easy to see all the consequences of a kernel change, demands developers with a relative full understanding of the ...

    UE(官方下载)

    This power tip provides an explanation as well as some tips to get the most out of temp files. Backup and Restore Settings One of the staples of UltraEdit (and UEStudio) is its highly configurable ...

    Duplicate Email Remover 2.7

    (you can find out this information through properties of the "My Computer" item on the desktop or the "System" item in the Control Panel). - Please try to provide as much information as possible...

    VB编程资源大全(英文源码 其它)

    6 , chunks.zip This will open a file and read it in "Chunks" of a selected file.<END><br>7 , logging.zip This is a bas that will log installation procedures so the file can be removed later....

    通信术语中英对照词典

    - **英文**: Home Exchange Home Office - **解释**: 指用户所在的本地交换局或办公场所,用于区别其他远程交换局或办公室。 33. **a.处理(呼叫,通信) b.处理(问题、意外) c.对待** - **中文**: 处理(呼叫...

    Linux操作系统基础教程

    清华大学信息学院计算机系 目 录 前言..................................................................................................................................................2 第一讲 ...

    Set-OutlookSignatures:用于文本签名和外出 (OOF) 自动回复消息的中央 Outlook for Windows 管理和部署脚本

    从 DOCX 或 HTML 文件格式的模板生成 使用广泛的变量进行自定义,包括来自 Active Directory 的照片 应用于所有邮箱、特定组或特定地址 指定的有效时间范围 设置为新邮件或回复和转发的默认签名(仅限签名) 设置为...

Global site tag (gtag.js) - Google Analytics