ImpersonationLogonAs Method
Makes the current thread impersonate the specified user account.

Namespace: MailBee.Security
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.5.0 build 687 for .NET 4.5
Syntax
public bool LogonAs(
	string accountName,
	string domainName,
	string password
)

Parameters

accountName
Type: SystemString
The name of the account being impersonated.
domainName
Type: SystemString
The name of the domain the specified account belongs to.
password
Type: SystemString
The password of the specified account.

Return Value

Type: Boolean
true if succeeded; otherwise, false.
Exceptions
ExceptionCondition
MailBeeInvalidArgumentExceptionaccountName is a null reference (Nothing in Visual Basic) or an empty string.
MailBeeImpersonationWin32ExceptionWin32 returned an error on attempt to complete impersonation and ThrowExceptions is true.
Remarks
The impersonation lasts until the current thread exits or Logoff method gets called.
See Also