Thetype exposes the following members.
Clears the log contents if logging is enabled.
async/await version of Clear.
Determines whether the specified object is equal to the current object.(Inherited from Object.)
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)
Serves as the default hash function.(Inherited from Object.)
Returns the string containing the memory log contents.
Gets the Type of the current instance.(Inherited from Object.)
Creates a shallow copy of the current Object.(Inherited from Object.)
Returns a string that represents the current object.(Inherited from Object.)
Adds a new log entry containing user-defined message into the log.
async/await version of WriteLine(String).
Gets or sets the format of full datetime string.
Gets or sets the format of time-only string.
Gets or sets whether the logging should be automatically disabled instead of throwing exception when logging error occurs.
Gets or sets whether the logging into a file or memory buffer is enabled.
Gets or sets Encoding to be used when writing into the log file.
Gets or sets the log file name.
Gets or sets flags which specify formatting of log entries placed into the log.
Gets or sets whether the actual password data may appear in the log or not.
Gets or sets whether the log file must be kept open during MailBee session.
Gets or sets whether DNS MX lookup query binary data must be added into the log.
Gets or sets the maximum allowed length (in characters) of the file or memory log.
Gets or sets whether the logging must be performed into a log file or into a memory buffer.
Gets or sets the name of a backup file the log must be renamed into when its size exceeds the maximum allowed limit.
Gets or sets the object to be used for synchronized access to the log file.
The log provides a lot of useful and detailed information on how MailBee communicates with mail or DNS servers. The logs keeps track of all occurred network connection and protocol errors as well.
class also supports logging into memory buffer instead of a file (useful for those ASP.NET applications which have no permissions to write to disk).
To prevent unlimited growth of the log file/memory buffer, the maximum size of the log can be restricted to certain value (see MaxSize property).
The developer has control of adding log messages. Each time the log entry is to be added into the log, MailBee components raise LogNewEntry event (see Smtp.LogNewEntry, Pop3.LogNewEntry, and Imap.LogNewEntry). Also, the developer can explicitly put new entries into the log using WriteLine(String) method.
|If C:\Temp\pop3_log.txt gets full again, it's again renamed to C:\Temp\pop3_log-bak.txt (old C:\Temp\pop3_log-bak.txt contents will be lost). Thus, the log will always reflect the latest activity, however, older data may be lost.|
// To use the code below, import MailBee namespaces at the top of your code. using MailBee; using MailBee.Pop3Mail; using MailBee.Mime; // The actual code (put it into a method of your class) Pop3 pop = new Pop3(); // Set logging parameters. pop.Log.Enabled = true; pop.Log.Filename = @"C:\Temp\pop3_log.txt"; pop.Log.MaxSize = 4096; pop.Log.OldFilename = @"C:\Temp\pop3_log-bak.txt"; // Download all message headers to produce some log messages. pop.Connect("mail.domain.com"); pop.Login("firstname.lastname@example.org", "password"); MailMessageCollection msgs = pop.DownloadMessageHeaders(); pop.Disconnect();
' To use the code below, import MailBee namespaces at the top of your code. Imports MailBee Imports MailBee.Pop3Mail Imports MailBee.Mime ' The actual code (put it into a method of your class). Dim pop As New Pop3 ' Set logging parameters. pop.Log.Enabled = True pop.Log.Filename = "C:\Temp\pop3_log.txt" pop.Log.MaxSize = 4096 pop.Log.OldFilename = "C:\Temp\pop3_log-bak.txt" ' Download all message headers to produce some log messages. pop.Connect("mail.domain.com") pop.Login("email@example.com", "password") Dim msgs As MailMessageCollection msgs = pop.DownloadMessageHeaders() pop.Disconnect()