TemplatedMailWebEventProvider クラス
アセンブリ: System.Web (system.web.dll 内)


運用および操作の担当者は、ASP.NET Health Monitoring を使用して、配置されている Web アプリケーションを管理できます。System.Web.Management 名前空間には、アプリケーションの状態データをパッケージ化する状態イベント型、およびそのデータを処理するプロバイダ型が含まれます。また、状態イベント管理を支援するサポート型も含まれます。
このクラスは、コードで使用するためのものではありません。ASP.NET Health Monitoring system がイベント通知を電子メールで送信するために作成、構成、および使用するものです。電子メール Web イベント プロバイダを定義する場合は、構成ファイルを使用します。このトピックにある「例」のセクションを参照してください。また、プログラムで HealthMonitoringSection.Providers プロパティにアクセスしてプロバイダ セクションを構成することもできます。
このクラスが生成する電子メールは、テンプレートを使用して定義および書式設定されます。このテンプレートは、メッセージ本文用のテキストを出力する標準的な .aspx ファイルに定義したマークアップ コードによって構成されます。テンプレートで使用するイベント情報は、MailEventNotificationInfo オブジェクトから提供されます。これは、このクラスの CurrentNotification 静的プロパティから取得できます。
このプロバイダには包括的な構成属性のセットがあり、これを使用して動作をカスタマイズできます。

以下は構成ファイルからの抜粋です。SimpleMailWebEventProvider 型のプロバイダを healthMonitoring セクションに指定する方法を示しています。rules セクションの add 要素では、このプロバイダが要求処理エラーおよびインフラストラクチャ エラーを処理することを指定しています。
<system.web> <healthMonitoring enabled="true" heartBeatInterval="0"> <bufferModes> <add name="Critical Notification" maxBufferSize="100" maxFlushSize="20" urgentFlushThreshold="1" regularFlushInterval="Infinite" urgentFlushInterval="00:01:00" maxBufferThreads="1" /> </bufferModes> <providers> <add name="CriticalMailEventProvider" type="System.Web.Management.TemplatedMailWebEventProvider, System.Web, Version=%ASSEMBLY_VERSION%, Culture=neutral, PublicKeyToken=%MICROSOFT_PUBLICKEY%" template="../mailtemplates/critical.aspx" from="sender address" to="someone@example.com" cc="someone@example.com" bcc="someone@example.com" priority="High" bodyHeader="Warning!" bodyFooter="Please investigate ASAP." subjectPrefix="Action required." buffer="true" bufferMode="Critical Notification" maxEventLength="4096" maxSize="4096" maxMessagesPerNotification="1" /> </providers> <eventMappings> <add name="Request Processing Events" type="System.Web.Management.WebRequestEvent, System.Web", Version=%ASSEMBLY_VERSION%, Culture=neutral, PublicKeyToken=%MICROSOFT_PUBLICKEY%" /> <add name="Infrastructure Errors" type="System.Web.Management.WebErrorEvent, System.Web, Version=%ASSEMBLY_VERSION%, Culture=neutral, PublicKeyToken=%MICROSOFT_PUBLICKEY%" /> </eventMappings> <profiles> <add name="Default" minInstances="1" maxLimit="Infinite" minInterval="00:10:00" /> <add name="Critical" minInstances="1" maxLimit="1024" minInterval="00:00:00" /> </profiles> <rules> <add name="Request Processing Errors" eventName="Request Processing Errors" provider="CriticalMailEventProvider" profile="Default" /> <add name="Infrastructure Notifications" eventName="Infrastructure Errors" provider="CriticalMailEventProvider" profile="Critical" /> </rules> </healthMonitoring> </system.web>

System.Configuration.Provider.ProviderBase
System.Web.Management.WebEventProvider
System.Web.Management.BufferedWebEventProvider
System.Web.Management.MailWebEventProvider
System.Web.Management.TemplatedMailWebEventProvider


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- TemplatedMailWebEventProvider クラスのページへのリンク