2012-03-26 66 views
0

EWSを使用して、受信トレイにStreamingSubscriptionを作成しています。 NewMailイベントをリッスンしています。 From Address、Subject、Body、To Address、CC Addressは引き出すことができますが、BCCアドレスは取得できません。このリストを見る方法はありますか?Exchange EWSがBCCの受信者を取得する

CODE:

static void OnEvent(object sender, NotificationEventArgs args) 
{ 
    String from = null; 
    String subject = null; 
    String body = null; 
    String to = null; 

    StreamingSubscription subscription = args.Subscription; 

    // Loop Through All Item-Related Events 
    foreach (NotificationEvent notification in args.Events) 
    { 
     ItemEvent item = (ItemEvent)notification; 

     PropertySet propertySet = new PropertySet(ItemSchema.UniqueBody); 
     propertySet.RequestedBodyType = BodyType.Text; 
     propertySet.BasePropertySet = BasePropertySet.FirstClassProperties; 

     // Parse Email 
     EmailMessage message = EmailMessage.Bind(service, item.ItemId, propertySet); 
     from = message.From.Address; 
     subject = message.Subject; 
     body = message.Body.Text; 

     if (message.ToRecipients.Count > 0) 
     { 
      to = message.ToRecipients[0].Address; 
      body += "\n TO FIELD"; 
     } 
     else if (message.CcRecipients.Count > 0) 
     { 
      to = message.CcRecipients[0].Address; 
      body += "\n CC FIELD"; 
     } 
/************** Does not work! BccRecipients is always empty *****************/ 
     else if (message.BccRecipients.Count > 0) 
     { 
      to = message.BccRecipients[0].Address; 
      body += "\n BCC FIELD"; 
     } 

/************* REST OF CODE ************************/ 
    } 
} 

答えて

1

種類のブラインド・カーボン・コピーのポイントを台無しにしてしまいます。私はそれができるとは思わない。

0

Exchangeのジャーナル機能を使用することを検討してください。これは、Exchange環境内のメッセージのBCC情報を含む「Envelope Journaling」と呼ばれるものを使用します。

外部ソース(gmail)に由来するものについては、BCC情報はありません。

関連する問題