Description
This function modifies a mail exchanger's settings.
Warning:
- UAPI (recommended) —
Email::change_mx
— This function modifies a Mail Exchanger (MX) record. - cPanel API 2 —
Email::changemx
— This function changes an MX entry's configuration.
Examples
This function does not return output.
Parameters
Parameter |
Type |
Description |
Possible values |
Example |
domain |
string |
Required The domain name. |
The mail exchanger's domain. |
example.com |
exchange |
string |
Required The mail exchanger's name. |
The mail exchanger's name, inname.example.com format, where example.com is the domain name. |
mail.example.com |
preference |
integer |
Required The mail exchanger's priority. |
An integer value. Note: It is common practice to set a priority value that is divisible by five. |
15 |
alwaysaccept |
string |
The mail exchanger's type. If you do not specify a value, the system uses your current configuration to determine the best type to use. |
|
local |
oldexchange |
string |
The name of the mail exchanger to replace. If you do not specify a value, the system creates a new mail exchanger. |
The name of an existing mail exchanger on the server, inname.example.com format, where example.com is the domain name. |
mail.example.com |
oldpreference |
integer |
The mail exchanger's previous priority value. If the value for the oldexchangeparameter matches multiple MX entries, the system uses this value to determine which MX entry to modify. |
The mail exchanger's previous priority value. |
45 |
Returns
This function does not return output.