Description
This function lists Mail Exchanger (MX) records.
Examples
Note:
Use cPanel's API Shell interface (Home >> Advanced >> API Shell) to directly test cPanel API calls.
Parameters
Parameter |
Type |
Description |
Possible values |
Example |
domain |
string |
The domain to query. If you do not use this parameter, the function returns MX records for all of the cPanel account's domains. |
A valid domain on the account. |
example.com |
Returns
Return |
Type |
Description |
Possible values |
Example |
statusmsg |
string |
A message of success, or an error message. |
|
Fetched MX List |
entries |
array of hashes |
An array of hashes of mail exchangers. |
Each hash includes the mx, priority,domain, entrycount, and row returns. |
|
mx |
string |
The mail exchanger's name. The function returns this value in the entries hash. |
A valid mail exchanger name. |
newmx.example.com |
priority |
integer |
The mail exchanger's priority value. The function returns this value in the entries hash. |
An integer. |
5 |
domain |
string |
The mail exchanger's domain. The function returns this value in the entries hash. |
A valid domain name on the cPanel account. |
example.com |
entrycount |
integer |
The mail exchanger's order in the list of priorities. The function returns this value in the entries hash. |
A positive integer. For example, the mail exchanger with the highest priority returns 1, and the next highest priority returns 2. |
1 |
row |
string |
Whether the mail exchanger is an odd or an even entry. The function returns this value in the entries hash. |
|
odd |
status |
Boolean |
Whether the function succeeded. |
|
1 |
local |
Boolean |
Whether the domain's highest priority mail exchanger is a local mail exchanger. |
|
1 |
detected |
string |
The domain's highest-priority mail exchanger's type. |
|
local |
remote |
Boolean |
Whether the domain's highest-priority mail exchanger is remote. |
|
0 |
mx |
string |
The domain's highest-priority mail exchanger's name. |
A valid mail exchanger on the domain or cPanel account. |
newmx.example.com |
domain |
string |
The domain. |
A valid domain on the cPanel account. |
example.com |
secondary |
Boolean |
Whether the domain's highest-priority mail exchanger is secondary. |
|
0 |
mxcheck |
string |
The domain's highest-priority mail exchanger's type. |
|
auto |
alwaysaccept |
Boolean |
Whether the domain's highest-priority mail exchanger accepts local mail. |
|
1 |