Description
This function sets the Mail Exchanger (MX) type.
Note:
This function only affects the cPanel configuration. You must configure the mail exchanger's DNS entry separately.
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 |
Required The mail exchanger's domain. |
A valid domain on the cPanel account. |
example.com |
mxcheck |
string |
The mail exchanger type. This parameter defaults to auto.
|
|
auto |
alwaysaccept |
Boolean |
Whether the mail exchanger always accepts mail for the domain. This parameter defaults to 1. |
|
1 |
Returns
Return |
Type |
Description |
Possible values |
Example |
statusmsg |
string |
A message of success or a reason for failure. |
|
Set Always Accept Status to: local |
checkmx |
hash |
A hash of the mail exchanger's data. |
This hash includes the warnings,issecondary, local, detected,remote, isprimary, changed,secondary, and mxcheck returns. |
|
warnings |
array |
An array of warning messages, if any exist. The function returns this value in the checkmx hash. |
One or more warning messages. |
|
issecondary |
Boolean |
Whether the mail exchanger is a secondary exchanger. The function returns this value in the checkmx hash. |
|
0 |
local |
Boolean |
Whether the mail exchanger is a local exchanger. The function returns this value in the checkmx hash. |
|
0 |
detected |
string |
The mail exchanger type. The function returns this value in the checkmx hash. |
|
auto |
remote |
Boolean |
Whether the mail exchanger is a remote exchanger. The function returns this value in the checkmx hash. |
|
0 |
isprimary |
Boolean |
Whether the mail exchanger is the primary mail exchanger. The function returns this value in the checkmx hash. |
|
0 |
changed |
Boolean |
Whether a change occurred during the function. The function returns this value in the checkmx hash. |
|
1 |
secondary |
Boolean |
Whether the mail exchanger is a secondary exchanger. The function returns this value in the checkmx hash. |
|
0 |
mxcheck |
string |
The mail exchanger type. The function returns this value in the checkmx hash. |
|
auto |
status |
Boolean |
Whether the function succeeded. |
|
1 |
local |
Boolean |
Whether the mail exchanger is a local exchanger. |
|
0 |
remote |
Boolean |
Whether the mail exchanger is a remote exchanger. |
|
0 |
detected |
string |
The mail exchanger type. |
|
auto |
mxcheck |
string |
The mail exchanger type. |
|
auto |
secondary |
Boolean |
Whether the mail exchanger is a secondary exchanger. |
|
0 |
results |
string |
A message of success or a reason for failure. |
|
Set Always Accept Status to: local |