LoggerWriteLine Method
Adds a new log entry containing user-defined message into the log.

Namespace: MailBee
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 11.2.0 build 590 for .NET 4.5
Syntax
public void WriteLine(
	string messageText
)

Parameters

messageText
Type: SystemString
The string to be added in the log as a part of the log entry.
Remarks

The developer can use this method to add custom messages in the log. These messages will be formatted to the same rules as any other messages placed into the log. However, MailBee components (such as Smtp, Pop3, and Imap) do not raise LogNewEntry event when the log entry is added using this method. This allows the developer to call this method even inside LogNewEntry event handlers without getting endless recursion in the code.

Entries added with WriteLine(String) method are marked as [USER] in the log (as compared to [INFO], [SEND], or [RECV] entries produced by MailBee itself).

Note Note
In UWP apps, use async version of this method.
Examples
This sample adds user-defined message into the file log.
// 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.Clear();

// Print Hello.
pop.Log.WriteLine("Hello");

// After running this code, C:\Temp\pop3_log.txt file should look like below.
[00:05:34.79] [USER] Hello
See Also