從收到的電子郵件創建「全部回覆」後,我需要刪除不允許接收此回覆的收件人。但是,在創建回覆消息後,回覆消息的收件人列表(ToRecipients,CcRecipients,BccRecipients)爲空。帶有Exchange EWS的C#服務:從新創建的回覆中讀取收件人
ResponseMessage responseMessage = email.CreateReply(true);
foreach (EmailAddress toRecipient in responseMessage.ToRecipients)
{
if (! _outboundEmailAdresses.Contains(toRecipient.Address))
{
responseMessage.ToRecipients.Remove(toRecipient.Address);
}
}
`
如果我通過email.ToRecipients迭代,我看到所有的收件人。如果我通過responseMessage.ToRecipients迭代,我看不到任何收件人。不應該email.CreateReply(true)將email.from和email.ToRecipients地址複製到responseMessage?