MailBee.NET Objects 7.1

Impersonation.Logoff Method 

Terminates the impersonation mode initiated with LogonAs call and reverts back to the user account the current thread was created on.

public bool Logoff();

Return Value

true if succeeded; otherwise, false.

Exceptions

Exception Type Condition
MailBeeInvalidStateException Not impersonated yet because LogonAs method has not yet been called.
MailBeeImpersonationWin32Exception Win32 returned an error on attempt to complete impersonation and ThrowExceptions is true.

See Also

Impersonation Class | MailBee.Security Namespace