CreateRuleOperation クラス

定義

受信トレイ ルールを作成する操作を表します。

public ref class CreateRuleOperation sealed : Microsoft::Exchange::WebServices::Data::RuleOperation
public sealed class CreateRuleOperation : Microsoft.Exchange.WebServices.Data.RuleOperation
Public NotInheritable Class CreateRuleOperation
Inherits RuleOperation
継承
CreateRuleOperation

次の例では、"MoveInterestingToJunk" という名前のルールを作成します。 ルールには Conditions 、件名に "Interesting" という文字列を含む電子メール メッセージが到着するたびに、メッセージを迷惑メール フォルダーに移動することを指定するプロパティがあります。 ルールは、サービス内のサーバーにアップロードされます。UpdateInboxRules(new RuleOperation[] { createOperation }, true) 行。

// Create an Inbox rule.
// If "Interesting" is in the message's subject line, move it into the Junk E-mail folder.
Rule newRule = new Rule();
newRule.DisplayName = "MoveInterestingToJunk";
newRule.Priority = 1;
newRule.IsEnabled = true;
newRule.Conditions.ContainsSubjectStrings.Add("Interesting");
newRule.Actions.MoveToFolder = WellKnownFolderName.JunkEmail;

// Create the CreateRuleOperation.
CreateRuleOperation createRuleOperation = new CreateRuleOperation(newRule);
service.UpdateInboxRules(new RuleOperation[] { createRuleOperation }, true);

注釈

受信トレイ ルールは、 Conditions メッセージがフォルダーに配信される際に、クライアントがメッセージを自動的に整理、分類、処理できるようにする、 のセットおよび関連付け Actions です。

このクラスは、 RuleOperation クラスから派生します。

ルールが作成されると、Exchange サーバーに格納されます。 メッセージが到着すると、Exchange サーバーはメッセージを評価し、それがルール を満たしているかどうかを判断します Conditions。 がある場合、Exchange サーバーは ルール Actionsに従ってメッセージを処理します。 たとえば、件名に特定の文字列を含む受信メールを自動的に所定のフォルダーに移動するように要求するルールを作成できます。

コンストラクター

CreateRuleOperation()

CreateRuleOperation クラスの新しいインスタンスを初期化します。

CreateRuleOperation(Rule)

指定した規則を使用して、CreateRuleOperation クラスの新しいインスタンスを初期化します。

プロパティ

Rule

作成するルールを取得または設定します。

適用対象