Partager via


IHostedEmailAdaptor.EnableAccount Method (String)

 

Enables an existing email account.

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

Syntax

void EnableAccount(
    string accountId
)
void EnableAccount(
    String^ accountId
)
Sub EnableAccount (
    accountId As String
)

Parameters

  • accountId
    Type: System.String

    The ID of an existing email account.

Remarks

This method is called by BeginEnableAccount and EnableAccount.

If your adapter does not support this method, be sure to tag your implementation method with NotSupportedAPIAttribute.

Examples

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

public void EnableAccount(string accountId)
{
    try
    {
        EmailService.EnableAccount(accountId);
    }
    catch (AccountNotExistsException)
    {
        throw new HostedEmailAdaptorException(HostedEmailAdaptorErrorCode.AccountNotExists, new AddinErrorRecord()
        {
            Message = Resources.ErrMsg_OnlineUserNotExist,
            Title = Resources.ErrTitle_OnlineUserNotExist,
        });
    }
}

See Also

IHostedEmailAdaptor Interface
Microsoft.WindowsServerSolutions.HostedEmail Namespace

Return to top