Updates the specified alias.
A GenericResult instance containing the results of the UpdateAlias action.
The list of addresses set with the Addresses parameter overwrites the current address list associated with the specified alias.
The following sample adds two new email addresses to the new_alias@domain.net alias. The old address list is first copied to an array. The new addresses are then added to the array, which is used to update the alias.
using System;
using System.Collections;
using svcAliasAdmin;
class svcAliasAdminUpdateAlias
{
static void Main()
{
string[] alias_list = new string[]{"email3@domain.net", "email4@domain.net"};
svcAliasAdmin alias = new svcAliasAdmin();
AliasInfoResult info = alias.GetAlias("admin@domain.net",
"alskdjfhtt",
"domain.net",
"new_alias");
if(info.Result)
{
//Adding existing addresses to ArrayList
ArrayList arr = new ArrayList(info.AliasInfo.Addresses);
//Adding new addresses to ArrayList
arr.AddRange(alias_list);
//Creating new string[] array from ArrayList
string[] new_alias_list = (string[]) arr.ToArray(typeof(string));
GenericResult status = alias.UpdateAlias("admin@domain.net",
"alskdjfhtt",
"domain.net",
"new_alias",
new_alias_list);
if(status.Result)
Console.WriteLine ("Alias updated");
else
Console.WriteLine (status.Message);
}else{
Console.WriteLine (info.Message);
}
}
}
svcAliasAdmin Class | svcAliasAdmin Namespace