views:

17

answers:

0

I have an action in DiagnosticsController called ErrorEmail but I get the following error when attempting to trigger a HealthMonitoring email. Any suggestions would be great.

Here are my web.config settings:

<providers>
  <add name="TemplatedEmailWebEventProvider" type="System.Web.Management.TemplatedMailWebEventProvider" template="Diagnostics/ErrorEmail" detailedTemplateErrors="true" maxMessagesPerNotification="1" maxEventsPerMessage="1" from="[email protected]" to="[email protected]" buffer="false" />
</providers>
<rules>
  <add name="All Errors Email" eventName="All Errors" provider="TemplatedEmailWebEventProvider" profile="Default"/>
</rules>

Here is my action code:

public class DiagnosticsController : MadHatterControllerBase
{
    public virtual ActionResult ErrorEmail()
    {
        var notification = TemplatedMailWebEventProvider.CurrentNotification;
        return Content( "<p>Test</p>" );
    }
}

And when I trigger an error, I get an email looking like the following:

alt text

In case image is unavailable...

Message: An unhandled exception occurred during the execution of the template page used to create this event notification. The 1 events that were part of this message were discarded.

Details: System.Web.HttpException: Error executing child request for /Admin/AZI/Diagnostics/ErrorEmail.