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
}
}
}
}
}
分享到:
相关推荐
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 ...
Chapter 9: Configuring Office Online Server for SharePoint Chapter 10: Workflow Manager Chapter 11: SharePoint and Exchange Integration Chapter 12: Business Intelligence Service Applications Chapter ...
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 ...
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....
清华大学信息学院计算机系 目 录 前言..................................................................................................................................................2 第一讲 ...
从 DOCX 或 HTML 文件格式的模板生成 使用广泛的变量进行自定义,包括来自 Active Directory 的照片 应用于所有邮箱、特定组或特定地址 指定的有效时间范围 设置为新邮件或回复和转发的默认签名(仅限签名) 设置为...