Click or drag to resize
MimeKit

ProtocolLogger Class

A protocol logger.
Inheritance Hierarchy
SystemObject
  MailKitProtocolLogger

Namespace:  MailKit
Assembly:  MailKit (in MailKit.dll) Version: 2.1.0.0
Syntax
C#
public class ProtocolLogger : IProtocolLogger, 
	IDisposable

The ProtocolLogger type exposes the following members.

Constructors
  NameDescription
Public methodProtocolLogger(Stream, Boolean)
Initializes a new instance of the ProtocolLogger class.
Public methodProtocolLogger(String, Boolean)
Initializes a new instance of the ProtocolLogger class.
Top
Methods
  NameDescription
Public methodDispose
Releases all resource used by the ProtocolLogger object.
Protected methodDispose(Boolean)
Releases the unmanaged resources used by the ProtocolLogger and optionally releases the managed resources.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Releases unmanaged resources and performs other cleanup operations before the ProtocolLogger is reclaimed by garbage collection.
(Overrides ObjectFinalize.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodLogClient
Logs a sequence of bytes sent by the client.
Public methodLogConnect
Logs a connection to the specified URI.
Public methodLogServer
Logs a sequence of bytes sent by the server.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Remarks
A protocol logger.
Examples
C#
public static void SendMessage (MimeMessage message)
{
    using (var client = new SmtpClient (new ProtocolLogger ("smtp.log"))) {
        client.Connect ("smtp.gmail.com", 465, SecureSocketOptions.SslOnConnect);

        client.Authenticate ("username", "password");

        client.Send (message);

        client.Disconnect (true);
    }
}
See Also