Apache log4net� SDK Documentation - Microsoft .NET Framework 4.0

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.


public�class�SmtpAppender : BufferingAppenderSkeleton

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.


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.


Namespace: log4net.Appender

Assembly: log4net (in log4net.dll)

See Also

SmtpAppender Members | log4net.Appender Namespace