第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定

EWS Managed API 2.0 設(shè)置獲取郵件自動回復(fù)功能

標(biāo)簽:
JavaScript

摘要

最近要在邮件提醒功能中添加,自动回复的功能。在移动端获取用户在outlook上是否开启了自动回复功能,如果用户在outlook上开启了自动回复功能, 获取用户自动回复的内容,如果没有开启,用户可以在移动端开启自动回复并且可以设置自动回复的内容,当然,用户也可以在移动端进行关闭。

一个例子

获取用户自动回复的信息。

复制代码

    class Program    {        static ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP1);        static void Main(string[] args)        {            service.Url = new Uri("https://xxxxx/exchange.asmx");            service.Credentials = new NetworkCredential("username", "userpwd", "domain");            var oofSettiing = service.GetUserOofSettings("username@xxxx.com");                       if (oofSettiing != null)            {                Console.WriteLine(oofSettiing.Duration.StartTime.ToString());                Console.WriteLine(oofSettiing.Duration.EndTime.ToString());                Console.WriteLine(oofSettiing.State.ToString());                Console.WriteLine(oofSettiing.ExternalReply.Message.ToString());                string msg = oofSettiing.ExternalReply.Message.ToString();                HtmlDocument doc = new HtmlDocument();                doc.LoadHtml(msg);                HtmlNodeCollection pLists = doc.DocumentNode.SelectNodes(".//p");                if (pLists != null && pLists.Count > 0)                {                    foreach (var item in pLists)                    {                        Console.WriteLine(item.InnerText);                    }                }            }            Console.Read();        }    }

复制代码

注意获取的自动回复内容为html标签的,所以需要过滤,这里使用HtmlAgilityPack组件,对html进行解析。

如图所示

设置自动回复

复制代码

  var myOOF = new OofSettings();            // Set the OOF status to be a scheduled time period.            myOOF.State = OofState.Scheduled;            // Select the time period during which to send OOF messages.            myOOF.Duration = new TimeWindow(DateTime.Now.AddDays(4), DateTime.Now.AddDays(5));            // Select the external audience that will receive OOF messages.            myOOF.ExternalAudience = OofExternalAudience.All;            // Set the OOF message for your internal audience.            myOOF.InternalReply = new OofReply("I'm out of office. I'll be back tomorrow. Thanks!");            // Set the OOF message for your external audience.            myOOF.ExternalReply = new OofReply("I'm out of the office but will reply to emails when I return. Thanks!");            service.SetUserOofSettings("user@xxxx.com", myOOF);

复制代码

资料

https://msdn.microsoft.com/en-us/library/hh532556(EXCHG.80).aspx

點擊查看更多內(nèi)容
TA 點贊

若覺得本文不錯,就分享一下吧!

評論

作者其他優(yōu)質(zhì)文章

正在加載中
  • 推薦
  • 評論
  • 收藏
  • 共同學(xué)習(xí),寫下你的評論
感謝您的支持,我會繼續(xù)努力的~
掃碼打賞,你說多少就多少
贊賞金額會直接到老師賬戶
支付方式
打開微信掃一掃,即可進(jìn)行掃碼打賞哦
今天注冊有機(jī)會得

100積分直接送

付費(fèi)專欄免費(fèi)學(xué)

大額優(yōu)惠券免費(fèi)領(lǐng)

立即參與 放棄機(jī)會
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號

舉報

0/150
提交
取消