LogFormatOptions Enumeration
Provides flags which can be used to change formatting of log messages produced by MailBee.

Namespace: MailBee
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 11.2.0 build 590 for .NET 4.5
Syntax
[FlagsAttribute]
public enum LogFormatOptions
Members
  Member nameValueDescription
None0 Use default formatting.
AddDate1 Include the current date in the timestamp.
AddContextInfo2 Include the information about the current thread ID and the current context (such as DNSQ (DNS Query), SMTP, POP3, SEND). Useful in multi-thread mode (when log messages, produced by different threads, overlap).
BinaryAsText4 Disable base64 encoding of binary data (usually, in DNS MX lookup queries).
Examples
This sample demonstrates the effect of different LogFormatOptions flags.
Note Note
The actual values can be different in your case.
using System;
using MailBee;
using MailBee.SmtpMail;

class Sample
{
    // LogNewEntry event handler.
    private static void OnLogNewEntry(object sender, LogNewEntryEventArgs e)
    {
        // For readability, reduce the number of log entries displayed.
        if (e.NewEntry.MessageType != LogMessageType.Recv)
        {
            e.NewEntry.AddThisEntry = false;
        }
    }

    // The actual code.
    static void Main(string[] args)
    {
        Smtp mailer = new Smtp();

        mailer.SmtpServers.Add("smtp.domain.com");

        // Enable logging the SMTP session into memory.
        mailer.Log.Enabled = true;
        mailer.Log.MemoryLog = true;

        // Subscribe to the LogNewEntry event.
        mailer.LogNewEntry += new LogNewEntryEventHandler(OnLogNewEntry);

        mailer.Log.Clear();
        mailer.Connect();
        Console.WriteLine("Format is None");
        Console.WriteLine(mailer.Log.GetMemoryLog());

        mailer.Log.Clear();
        mailer.Log.Format = LogFormatOptions.AddContextInfo;
        mailer.Hello();
        Console.WriteLine("Format is AddContextInfo");
        Console.WriteLine(mailer.Log.GetMemoryLog());

        mailer.Log.Clear();
        mailer.Log.Format = LogFormatOptions.AddDate;
        mailer.Noop();
        Console.WriteLine("Format is AddDate");
        Console.WriteLine(mailer.Log.GetMemoryLog());

        mailer.Log.Clear();
        mailer.Log.Format = LogFormatOptions.AddContextInfo | LogFormatOptions.AddDate;
        mailer.Disconnect();
        Console.WriteLine("Format is AddContextInfo | AddDate");
        Console.WriteLine(mailer.Log.GetMemoryLog());    
    }
}

// The output (the actual content will be different for your case).
Format is None
[18:55:15.26] [RECV] 220 smtp.domain.com: please say hello\r\n

Format is AddContextInfo
[18:55:15.30] [RECV] [0020] [SMTP-00................] 250-smtp.domain.com: EHLO NOTEBOOK1 accepted\r\n250

Format is AddDate
[11/08/2005 18:55:15.31] [RECV] 250 OK\r\n

Format is AddContextInfo | AddDate
[11/08/2005 18:55:15.32] [RECV] [000A] [SMTP-00................] 221 smtp.domain.com: see you later\r\n
See Also