Partager via


IHostedEmailAdaptor.Connect Method ()

 

Connects to the hosted email provider for a user management session.

Namespace:   Microsoft.WindowsServerSolutions.HostedEmail
Assembly:  Wssg.HostedEmailBase (in Wssg.HostedEmailBase.dll)

Syntax

void Connect()
void Connect()
Sub Connect

Remarks

This method is designed for opening a session you will use to manage a user email account, and is similar to a sign-in operation. Because this method does not have any parameters, you should retrieve the relevant sign-in information from storage. The admin name and password (or equivalent) should have been passed in by a previous call to Activate.

Before you attempt any additional account management operations, you must first call Connectand successfully make a connection. If you do not successfully make a connection first, all account management operations will fail.

Examples

The following code implements the Connect method. For the complete sample code, see Quickstart: Creating a Hosted Email Adapter.

public void Connect()
{
    if (!IsActivated)
    {
        connected = false;
    }
    connected = EmailService.Logon(CredentialManager.AdminUserName, CredentialManager.AdminPassword);
}

See Also

IHostedEmailAdaptor Interface
Microsoft.WindowsServerSolutions.HostedEmail Namespace

Return to top