IMAP “Not in the authenticated state” Error

The blog post explains the “Not in the authenticated state” error.

ChilkatLog:
SelectMailbox:
DllDate: Feb 15 2010
UnlockPrefix: Anything for 30-day trial
Username: NETWORK SERVICE
Component: .NET 2.0
mailbox: Inbox
Not in the authenticated state

This error happens if the caller is either not connected to an IMAP server, or is connected but the Login method was never called or did not complete successfully. It can happen for one of the following reasons:

  1. A previous IMAP method call failed because of a lost connection; perhaps the application did not check the return status for success failure. (It is important to check the return status of all method calls involving Internet communications.)
  2. The Connect and/or Login methods were never called.
  3. The return values of the Connect and/or Login methods were not checked for success/failure and a failure was not noticed.