Share via


IHostedEmailAdaptor.GetAccount Method (String)

 

Retrieves the account information of the specified email account.

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

Syntax

EmailAccountInfo GetAccount(
    string accountId
)
EmailAccountInfo^ GetAccount(
    String^ accountId
)
Function GetAccount (
    accountId As String
) As EmailAccountInfo

Parameters

  • accountId
    Type: System.String

    The ID of the account to retrieve

Return Value

Type: Microsoft.WindowsServerSolutions.HostedEmail.EmailAccountInfo

A EmailAccountInfo that contains the specified email account information.

Remarks

This method is called by BeginGetAccount and GetAccount.

Examples

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

public EmailAccountInfo GetAccount(string accountId)
{
    try
    {
        return EmailService.GetAccountById(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