Share via


IHostedEmailAdaptor.DisableAccount Method (String)

 

Disables an existing email account.

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

Syntax

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

Parameters

Remarks

This method is called by calling BeginDisableAccount or DisableAccount.

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

Examples

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

public void DisableAccount(string accountId)
{
    try
    {
        EmailService.DisableAccount(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