我正在使用href
查找特定的电子邮件并全部回复。我知道使用System.Net.Mail的Microsoft.Exchange.WebServices.Data.ExchangeService
,我可以设置MailMessage
属性。我没有使用Priority
看到相同的内容?
ExchangeService
它找到了一封电子邮件:
var exchangeService = new ExchangeService(ExchangeVersion.Exchange2013_SP1);
exchangeService.Credentials = new WebCredentials("usr", "pw", "myDomain.com");
exchangeService.TraceEnabled = false;
exchangeService.AutodiscoverUrl($"{usr}@myDomain.com", AutodiscoverRedirectionUrlValidationCallback);
它会创建一个全部回复电子邮件:
var filter = new SearchFilterCollection(LogicalOperator.And, new IsEqualTo(EmailMessageSchema.IsRead, false));
var results = exchangeService.FindItems(WellKnownFolderName.Inbox, filter, new ItemView(50));
var interesting = results.Items.FirstOrDefault(e => e.Subject == "interesting");
答案 0 :(得分:1)
在做var response = interesting.CreateReply(true);
之前
设置有趣变量的重要性,如此
interesting.Importance = Importance.Low;
注意:如果var interesting
不是EmailMessage
,则首先投放它。它可能是Item
当您致电CreateReply()
时,重要性会延续到回复中。
我测试了这个
var interesting = results.Items.FirstOrDefault();
var orignal = (EmailMessage)interesting;
orignal.Importance = Importance.Low; orignal.CreateReply(true);
orignal.Subject = "Low priority";
orignal.ToRecipients.Add("myemail@domain.com");
orignal.SendAndSaveCopy();
原始电子邮件是高优先级,响应是低优先级