Written by Sonu Kapoor
Website: www.dotnetslackers.com
Blog: www.kapoorsolutions.com/blog
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.
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:
<gotdotnet.elmah>
section
add the following:<errorMail from="intranet@example.org" to="sonuk@example.org" userName="username"
password="secretpassword" smtpServer="mail.example.org" />
userName
, password
and the smtpServer
(and optionally
smtpPort
) settings, which are required for the module. <httpModules>
section add the following:<add name="ErrorMail" type="GotDotNet.Elmah.ErrorMailModuleExtension,
ErrorMailModuleExtension"
/>
A web.config example is attached in this zip file.
Please post comments, bugs, questions and feedback on the ELMAH GotDotNet Workspace.