MailBee.NET Objects 4.0

Smtp.Log Property

Gets the object used for logging MailBee activities into a file or memory buffer.

public MailBee.Logger Log {get;}

Property Value

A reference to the object used for logging MailBee activities into a file or memory buffer.

Remarks

This property is never a null reference (Nothing in Visual Basic) even if logging is not used.

Example

This sample sets file logging on and sets the filename of the log file.

[C#]
// To use the code below, import MailBee namespaces at the top of your code.
using MailBee;
using MailBee.SmtpMail;

// The actual code (put it into a method of your class)

Smtp mailer = new Smtp();
mailer.Log.Enabled = true;
mailer.Log.Filename = @"C:\log.txt";
mailer.SmtpServers.Add("smtp.domain.com");
mailer.Connect();
mailer.Disconnect();
[Visual Basic]
' To use the code below, import MailBee namespaces at the top of your code.
Imports MailBee
Imports MailBee.SmtpMail

' The actual code (put it into a method of your class)

Dim mailer = New Smtp
mailer.Log.Enabled = True
mailer.Log.Filename = "C:\log.txt"
mailer.SmtpServers.Add("smtp.domain.com")
mailer.Connect()
mailer.Disconnect()

See Also

Smtp Class | MailBee.SmtpMail Namespace