Description

This function lists the account's mail domains.

Examples




https://hostname.example.com:2083/cpsess##########/execute/Email/list_mail_domains?select=example.com



$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// List the account's mail domains.
$get_mail_domains = $cpanel->uapi(
    'Email', 'list_mail_domains',
    array(
        'select'        => 'example.com',
         )
);

 



my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# List the account's mail domains.
my $get_mail_domains = $cpliveapi->uapi(
    'Email', 'list_mail_domains',
    {
        'select'        => 'example.com',
    }
);

 



<!-- List the account's mail domains. -->
[% execute('Email', 'list_mail_domains', { 'select' => 'example.com' } ) %]

 



uapi --user=username Email list_mail_domains select=example.com



{  
   "messages":null,
   "errors":null,
   "status":1,
   "metadata":{  
      "transformed":1
   },
   "data":[  
      {  
         "domain":"example.com",
         "select":1
      },
      {  
         "domain":"addondomain.com"
      },
      {  
         "domain":"subdomain.example.com"
      },
      {  
         "domain":"seconddomain.com"
      },
      {  
         "domain":"seconddomain.example.com"
      }
   ]
}



Parameters

ParameterTypeDescriptionPossible valuesExample
selectstring

The name of the domain that the function returns with the select output parameter.

If you do not use this parameter, the function will not return the select parameter with any domains.

A valid domain on the account.

example.com
add_wwwBoolean

Whether to list www. addresses.

This parameter defaults to 0.

  • 1 — List www. addresses.
  • 0 — Do not list www. addresses.

For example, if you specify 1, the function's output would include both   example.com   and www.example.com . If you specify 0, the output would include only example.com .

1
include_wildcardBoolean

Whether to list wildcard addresses.

This parameter defaults to 0.

  • 1 — List wildcard addresses.
  • 0 — Do not list wildcard addresses.

For example, if you specify 1, the function's output would include both   example.com   and *.example.com . If you specify 0, the output would include only example.com .

1

Returns

This function always returns the account's main domain first. 


ReturnTypeDescriptionPossible valuesExample
domainstringThe domain name.

The name of a main domain, addon domain, or subdomain on the cPanel account.

example.com

selectBoolean

The domain that you specified in the select input parameter.

The function only returns this value if you included the select parameter when you called the function.

1 is the only possible value.

Because this value only appears if you included the select input parameter, The value always defaults to 1


1