Description
This function lists all of a cPanel account's mail domains, with one domain preselected.
Examples
LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
$list_mail_domains_opt = $cpanel->api1('Email', 'listmaildomainsoptndef', array('example.com') ); // Call the function.
LiveAPI Perl Module
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
my $list_mail_domains_opt = $cpliveapi->api1('Email', 'listmaildomainsoptndef', ['example.com'] ); # Call the function.
cPanel Tag System (deprecated)
Warning:
In cPanel & WHM version 11.30 and later, cPanel tags are deprecated. This example is present in order to help developers move from the old cPanel tag system to our LiveAPI.
We strongly recommend that you only use the LiveAPI system to call the cPanel APIs.
<cpanel Module="Email::listmaildomainsoptndef('sdomain') )">
Output (HTML)
<option value="example.com" selected>example.com</option>
<option value="exampledomain.com">exampledomain.com</option>
<option value="domain.com">domain.com</option>
Parameters
Parameter
|
Type
|
Description
|
Possible values
|
Example
|
sdomain
|
string
|
Required
The domain to mark as selected in the function's results.
|
A valid mail domain.
|
example.com
|
Returns
This function returns a list of each mail domain on the account, wrapped in <option>
tags.
The domain that you specified in the sdomain
parameter will include the selected
option in its <option>
tag.