log4net SDK Reference

SmtpAppender Class

Send an e-mail when a specific logging event occurs, typically on errors or fatal errors.

For a list of all members of this type, see SmtpAppender Members.

System.Object
   log4net.Appender.AppenderSkeleton
      log4net.Appender.BufferingAppenderSkeleton
         log4net.Appender.SmtpAppender

[Visual Basic]
Public Class SmtpAppender
    Inherits BufferingAppenderSkeleton
[C#]
public class SmtpAppender : BufferingAppenderSkeleton

Thread Safety

This type is not safe for multithreaded operations.

Remarks

The number of logging events delivered in this e-mail depend on the value of BufferSize option. The SmtpAppender keeps only the last BufferSize logging events in its cyclic buffer. This keeps memory requirements at a reasonable level while still delivering useful application context.

CAUTION    Authentication and setting the server Port are only available on the MS .NET 1.1 runtime. For these features to be enabled you need to ensure that you are using a version of the log4net assembly that is built against the MS .NET 1.1 framework and that you are running the your application on the MS .NET 1.1 runtime. On all other platforms only sending unauthenticated messages to a server listening on port 25 (the default) is supported.

Authentication is supported by setting the Authentication property to either Basic or Ntlm. If using Basic authentication then the Username and Password properties must also be set.

To set the SMTP server port use the Port property. The default port is 25.

Requirements

Namespace: log4net.Appender

Assembly: log4net (in log4net.dll)

See Also

SmtpAppender Members | log4net.Appender Namespace