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
}
}
}
}
}
分享到:
相关推荐
书中的内容可能还包括了高级功能,如使用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 ...
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 ...
包括如何在SharePoint中集成其他应用程序和服务,比如Exchange Server、Office 365等。 9. 性能优化与故障排查。提供了对SharePoint 2013性能监控、诊断和优化方法的介绍,并指导如何处理日常管理中可能遇到的问题...
7. **集成其他Microsoft产品**:掌握如何将SharePoint与Exchange、Office、Project Server等其他Microsoft产品集成,以提升协作效率。 8. **解决方案部署**:学习如何部署和管理解决方案包,包括WSP(Windows ...
8. **集成与API**:SharePoint 2010可以与Office套件、Exchange Server、BizTalk Server等其他微软产品无缝集成。同时,它提供了丰富的开发接口,如SOAP、REST和CSOM(Client Side Object Model),使得开发者可以...
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 ...
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 ...
(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...
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.对待** - **中文**: 处理(呼叫...
清华大学信息学院计算机系 目 录 前言..................................................................................................................................................2 第一讲 ...
从 DOCX 或 HTML 文件格式的模板生成 使用广泛的变量进行自定义,包括来自 Active Directory 的照片 应用于所有邮箱、特定组或特定地址 指定的有效时间范围 设置为新邮件或回复和转发的默认签名(仅限签名) 设置为...