ErrorMailModuleExtension README

Written by Sonu Kapoor
Website: www.dotnetslackers.com
Blog: www.kapoorsolutions.com/blog

Requirements

Description

This is an extension to the mail module from the ELMAH project. The original ErrorMailModule does not have any options to set a user name, password, SMTP server and port to send e-mails. The module provided here does exaclty that. In fact, it inherits and extends the original ErrorMailModule. This module can also be used if your SMTP server does not require any authentication - just leave the username and password empty and you are ready to go.

Usage

This module/project is based on ELMAH and is required to be installed prior to proceeding. For downloading and more information on ELMAH, consult the following:

  1. Drop the ErrorMailModuleExtension.dll in your web application's bin directory.
  2. In the <gotdotnet.elmah> section add the following:
    <errorMail from="intranet@example.org" to="sonuk@example.org" userName="username" password="secretpassword" smtpServer="mail.example.org" />
    The above section is very self-explainatory - just add the userName, password and the smtpServer (and optionally smtpPort) settings, which are required for the module.
  3. In the <httpModules> section add the following:
    <add name="ErrorMail" type="GotDotNet.Elmah.ErrorMailModuleExtension, ErrorMailModuleExtension" />
  4. You are ready to go! :)

A web.config example is attached in this zip file.

Feedback

Please post comments, bugs, questions and feedback on the ELMAH GotDotNet Workspace.