This class is used for logging the IMAP session.
For a list of all members of this type, see IMAPLog Members.
System.Object
IMAPLog
Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.
When encountering problems with aspNetIMAP, enable logging and inspect the log. Many times errors and exceptions are written the log that can greatly decrease the amount of trouble shooting.
[C#]
IMAP4 imap = new IMAP4( "127.0.0.1" );
imap.Logger = new IMAPLog();
imap.Logger.InMemory = true;
imap.Logger.Path = "C:\\imap.log"
imap.Username = "dave@blah.com";
imap.Password = "test";
imap.Login();
//list all of the folders
MailFolderCollection mfc = imap.FolderList();
Console.WriteLine( mfc.ToString() );
//write out the log
Console.WriteLine( imap.Logger.ToString() );
imap.Disconnect();
Console.WriteLine( "Done" );
Console.ReadLine();
[VB.NET]
Dim imap As New IMAP4("127.0.0.1")
imap.Logger = New IMAPLog()
imap.Logger.InMemory = True
imap.Logger.Path = "C:\imap.log"
imap.Username = "dave@blah.com"
imap.Password = "test"
imap.Login()
REM -- list all of the folders
Dim mfc As MailFolderCollection = imap.FolderList()
Console.WriteLine(mfc.ToString())
REM -- write out the log
Console.WriteLine(imap.Logger.ToString())
imap.Disconnect()
Console.WriteLine("Done")
Console.ReadLine()
Namespace: aspNetIMAP
Assembly: aspNetIMAP (in aspNetIMAP.dll)