Partager via


IHostedEmailAdaptor.DeleteAccount Method (String)

 

Deletes an existing email account.

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

Syntax

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

Parameters

Remarks

This method is called when BeginDeleteAccount or DeleteAccount is called.

Examples

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

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